/**
 * Copyright (c) 2014, 2017, Oracle and/or its affiliates.
 * The Universal Permissive License (UPL), Version 1.0
 */
"use strict";
define(["ojs/ojcore","jquery","ojs/ojcomponentcore","ojdnd"],function(a,g){function b(){}b.Gl="oj-expanded";b.Qh="oj-collapsed";b.Su="oj-hover";b.Wm="oj-selected";b.Ye="oj-disabled";b.GMa="oj-default";b.by="oj-treenode-temp";a.wa=function(a){this.Init(a)};a.b.sa(a.wa,a.b,"oj.TreeDndContext");a.wa.prototype.Init=function(b){a.wa.u.Init.call(this);this.R=b;this.options=b.options;this.pca()};a.b.g("TreeDndContext.prototype.Init",{Init:a.wa.prototype.Init});a.wa.prototype.uZ=function(){var a=this.Gd;
return a.reorder||a.fj};a.wa.prototype.KJa=function(){var a=this.Gd;return a.reorder||a.Fn};a.wa.prototype.VIa=function(){var b=this.Gd,d=a.wa,e=b.reorder,f=b.fj;this.D6();this.Nha();b=this.Gd;if(e!=b.reorder||f!=b.fj)b.reorder||b.fj||this.R.ra.find("li").removeClass(d.mQ).removeClass(d.zH).removeClass(d.bs).removeAttr("draggable");this.Mha()};a.wa.prototype.Nha=function(){var b=this.options.dnd,d=this.Gd,e=a.wa,f=!0,h;d.reorder=!1;"object"!=typeof b?this.options.dnd={reorder:"disable"}:(h=b[e.Jma],
"string"===typeof h&&("enable"===h?(d.reorder=!0,f=!1):"disable"==h&&(f=!1)),f&&(this.options.dnd.reorder="disable"),h=b[e.Ama],"object"==typeof h&&(h=h[e.W1],"object"==typeof h&&(f=h[e.Dma],"function"==typeof f&&(d.oF=f,d.fj=!0),f=h[e.Bma],"function"==typeof f&&(d.yM=f,d.fj=!0),f=h[e.Cma],"function"==typeof f&&(d.qY=f,d.fj=!0),f=h[e.V1],g.isArray(f)?(d.Gw=f.slice(),d.fj=!0):"string"==typeof f&&(d.Gw=[f],d.fj=!0))),h=b[e.Ema],"object"==typeof h&&(h=h[e.W1],"object"==typeof h&&(f=h[e.Fma],"function"==
typeof f&&(d.AM=f,d.Fn=!0),f=h[e.Hma],"function"==typeof f&&(d.CM=f,d.Fn=!0),f=h[e.Gma],"function"==typeof f&&(d.BM=f,d.Fn=!0),f=h[e.Ima],"function"==typeof f&&(d.DM=f,d.Fn=!0),f=h[e.V1],g.isArray(f)?(d.zM=f.slice(),d.Fn=!0):"string"==typeof f&&(d.zM=[f],d.Fn=!0))),d.reorder||(d.Gw||d.oF||(d.fj=!1,d.oF=d.yM=d.qY=d.Gw=null),d.DM||(d.Fn=!1,d.AM=d.CM=d.BM=d.DM=d.zM=null)),d.eO=d.reorder&&!d.fj)};a.wa.prototype.Mha=function(){var b=this.Gd,d=b.Cf,e=a.wa;if(b.fj||b.Fn||b.reorder){a.wa.J6?(d.Fp=a.wa.J6,
d.wm=a.wa.mta):(d.Fp=g("\x3cdiv class\x3d'oj-tree-drop-marker'\x3e\x3cspan class\x3d'oj-tree-drop-ptr oj-component-icon'\x3e\x26#160;\x3c/span\x3e\x3c/div\x3e").css("pointer-events","none").hide().appendTo("body"),d.wm=g("\x3cdiv /\x3e").addClass(e.Ona).css("pointer-events","none").hide().appendTo("body"),a.wa.J6=d.Fp,a.wa.mta=d.wm);b.Nia=d.wm.width();var d=this.R.element[0],f=g(d).children("ul:eq(0)");if(b.reorder||b.fj)b.AY=this.HS.bind(this),b.wY=this.jta.bind(this),g(d).on("dragstart",b.AY),g(d).on("dragend",
b.wY),f.length&&f.find("li").addClass(e.mQ).addClass(e.zH).addClass(e.bs).attr("draggable","true");if(b.reorder||b.Fn)b.uY=this.hta.bind(this),b.xY=this.kta.bind(this),b.zY=this.ota.bind(this),b.yY=this.lta.bind(this),b.vY=this.ita.bind(this),g(d).on("drag",b.uY),g(d).on("dragenter",b.xY),g(d).on("dragover",b.zY),g(d).on("dragleave",b.yY),g(d).on("drop",b.vY)}};a.wa.prototype.pra=function(){this.D6()};a.wa.prototype.HS=function(c){var d,e,f=g(c.target).closest("li"),h=c.originalEvent.dataTransfer,
k;d=this.Gd;e=d.Cf;e.kc=null;e.Pa=null;d.dx=null;d.f_=null;d.lG=null;d.pF=!1;if(!d.reorder&&!d.fj||f.hasClass(b.Ye)||this.R.i.la.locked)c.preventDefault();else{e=this.R.isSelected(f)?this.R.Ka(null,!0):e=f;(d.fj||d.eO)&&this.ADa(h,e);this.CDa(h,e);if(d.oF){k=d.oF(c,{item:void 0});if(c.isDefaultPrevented()||"boolean"===typeof k&&!k)return k;if(!d.Gw&&!this.Tqa(h)&&!d.reorder)return c.preventDefault(),!1}"uninitialized"===h.effectAllowed&&(h.effectAllowed=d.eO?"move":a.D.qr(c)?"copy":"move");this.$sa(e,
f,c)}};a.wa.prototype.hta=function(a){var b=this.Gd;b.yM&&b.yM(a)};a.wa.prototype.kta=function(c){this.R.ra[0].firstChild||this.ypa();var d=g(c.target),e=this.R.Ka(d),f=this.Gd,h=f.Cf,k=e&&0<e.length&&e.hasClass("oj-tree-node"),l=c.originalEvent.dataTransfer,m=a.wa,r=!1,t=!1,s;k&&e.hasClass(b.by)&&(f.lp=!0);if(!k||"UL"!=c.target.tagName||"group"!=c.target.getAttribute("role"))if(f.qi=!f.pF,!f.qi&&!f.reorder||f.qi&&this.fV(l,m.XP))this.mv();else{if(f.qi&&(r=this.fV(l,m.WP),!f.Fn)){this.mv();return}h.Pa=
!1;f.dx&&this.EC(f.dx);d.hasClass("oj-tree")&&(e=f.dx);if(!e||!e.length||e.attr("id")!=f.lG){r&&k&&(f.dx=null,h.kc=2);f.qi&&!r&&(h.kc=1);h.Pa=e;f.dx=e;this.E6(c,e);if(this.Vsa()){h.Pa.removeClass(m.nQ).addClass(m.bs).addClass(m.P2);f.AM&&(s=f.AM(c,{item:f.lp?null:e,position:f.lp?"first":f.sj,reference:f.lp?null:h.Pa}));if(void 0===s)this.L$(l)?(c.preventDefault(),c.stopPropagation()):t=f.qi||!f.reorder;else if(!1===s||c.isDefaultPrevented())c.preventDefault(),c.stopPropagation();else if(f.qi||!f.reorder)t=
f.qi||!f.reorder;t&&this.mv();return s}this.EC(h.Pa);h.Pa=null}this.Fy()}};a.wa.prototype.ota=function(a){var b=this.Gd,e=b.Cf,f=a.originalEvent.dataTransfer,g=!1,k,l,m;if(e.Pa&&e.Pa.length&&(l=e.Pa,l.hasClass("oj-tree-node")&&(k=l.attr("id"),k!=b.lG&&(this.E6(a,l),this.CS())))){b.CM&&(m=b.CM(a,{item:b.lp?null:l,reference:b.lp?null:e.Pa,position:b.lp?"first":e.DZ}));if(void 0===m)this.L$(f)?(a.preventDefault(),a.stopPropagation()):g=b.qi||!b.reorder;else if(!1===m||a.isDefaultPrevented())a.preventDefault(),
a.stopPropagation();else if(b.qi||!b.reorder)g=b.qi||!b.reorder;g&&this.mv();return m}this.Fy()};a.wa.prototype.ita=function(a){var b=this.Gd,e=b.Cf,f=!1,g;if(e.Pa){if(b.DM)g=b.DM(a,{reference:b.lp?null:e.Pa,position:b.lp?"first":e.DZ,reorder:!b.qi&&b.reorder});else if(b.qi||!b.reorder)f=!0;f||g&&!a.isDefaultPrevented()||this.Wsa(a)}b.qi&&this.mv();f||(a.preventDefault(),a.stopPropagation());b.f_=null;return g};a.wa.prototype.jta=function(a){var b=this.Gd,e=b.Cf;b.qY&&b.qY(a,{reorder:b.reorder&&!1===
e.kc});this.ata();this.mv()};a.wa.prototype.ypa=function(){this.B$||(this.B$=g("\x3cli class\x3d'"+b.by+" oj-tree-node oj-tree-leaf oj-valid-drop' id\x3d'"+b.by+"'\x3e\x3cins class\x3d'oj-tree-icon'\x3e\x3c/ins\x3e\x3ca href\x3d'#'\x3e\x3cins class\x3d'oj-tree-icon'\x3e\x3c/ins\x3e\x3cspan class\x3d'oj-tree-title'\x3e\x3c/span\x3e\x3c/a\x3e\x3c/li\x3e"));this.R.ra.append(this.B$)};a.wa.prototype.lta=function(a){var b=this.Gd,e=b.Cf,f=g(a.target),h=f.closest("li"),k=h&&0<h.length&&h.hasClass("oj-tree-node");
h.attr("id");var l=a.originalEvent.dataTransfer;b.BM&&b.BM(a,{item:b.lp?null:h});f.hasClass("oj-tree")||!k||"none"==l.dropEffect?this.Xsa(a):b.f_=h;e.Pa&&this.EC(e.Pa)};a.wa.prototype.Vsa=function(){var a=this.Gd,d=a.Cf,e;a.cO=!1;e=this.CS();var f=a.wKa;f&&(a.fOa&&clearTimeout(a.Er),d.Pa&&d.Pa.length&&d.Pa.hasClass(b.Qh)&&(a.Er=setTimeout(this.Ysa.bind(this),f)));a=typeof e;return"boolean"==a&&e||"string"==a};a.wa.prototype.Ysa=function(){var a=this.Gd,b=a.Cf;a.Er=!1;this.R.cg(b.Pa,this.CS.bind(this),
!0)};a.wa.prototype.Wsa=function(b){var d=this.Gd,e=d.Cf;d.pF&&d.reorder&&"object"==typeof e.kc&&0<e.kc.length&&(this.R.cE(e.kc,e.Pa,e.DZ,a.D.qr(b)),e.kc=!1)};a.wa.prototype.SI=function(a){a.hasClass(b.Wm)&&(a.removeClass(b.Wm),this.R.yn(a,!0));var d=(a=this.R.getChildren(a))&&a.length?a.length:0,e;for(e=0;e<d;e++)this.SI(g(a[e]))};a.wa.prototype.E6=function(a,d){var e=this.Gd;d&&(d.hasClass(b.by)?e.sj="after":(a=a.originalEvent,e.off=d.offset(),e.sj=a.pageY-(e.off.top||0),e.sj=e.sj>=this.R.i.la.Ht?
"after":0>e.sj?"before":"inside","after"===e.sj&&d.hasClass(b.Gl)&&(e.sj="first")))};a.wa.prototype.Xsa=function(a){var b=this.Gd,e=b.Cf;b.after=!1;b.before=!1;b.BA=!1;b.TNa=null;this.Fy();e.Pa&&e.Pa[0]===a.target.parentNode&&b.Er&&(clearTimeout(b.Er),b.Er=!1)};a.wa.prototype.mv=function(){this.Fy();var a=this.Gd,b=a.Cf;b.kc=!1;b.Pa=!1;a.Er&&clearTimeout(a.Er);a.lG=null;a.qi=!1;a.dx=null;a.f_=null;a.after=!1;a.before=!1;a.BA=!1;a.off=!1;a.cO=!1;a.Er=!1;a.qi=!1;a.lp=!1};a.wa.prototype.D6=function(){var a=
this.Gd,b;b=g(this.R.Qa[0]);b.off("dragstart",a.AY);b.off("dragend",a.wY);b.off("drag",a.uY);b.off("dragenter",a.xY);b.off("dragover",a.zY);b.off("dragleave",a.yY);b.off("drop",a.vY);this.mv();this.pca()};a.wa.prototype.CS=function(){var a=this.Gd,b=a.Cf,e=this.R,f=!1;if(!b.Pa||!b.Pa.length)return!1;if("number"==typeof b.kc&&(1===b.kc||2===b.kc))f=!0;else if(!b.kc)return!1;a.off=b.Pa.offset();this.R.BK&&(a.off.right=a.off.left+b.Pa.width()-b.Pa.find("\x3ea").width()-30);a.pka=b.Pa.find("a").width();
f?(a.before="before"==a.sj,a.after="after"==a.sj,a.BA="inside"==a.sj):(e.nE(b.kc,b.Pa,"before"),a.before=e.vI(),e.nE(b.kc,b.Pa,"after"),a.after=e.vI(),this.R.Iq(b.Pa)?(e.nE(b.kc,b.Pa,"inside"),a.BA=e.vI()):a.BA=!1);a.cO=!0;return this.Zsa()};a.wa.prototype.Zsa=function(){var b=this.Gd,d=!1,e=a.wa,f=b.Cf,g=this.R.BK,k,l,m,r=this.R.i.la.Ht,t=!1;if(!b.cO)return this.Fy(),t;if("after"==b.sj&&b.after||"inside"==b.sj&&b.BA||"before"==b.sj&&b.before||"first"==b.sj)t=b.sj;"first"===t&&(d=f.Pa.find("li:eq(0)"),
b.off=d.offset());l=g?b.off.right-18:b.off.left+5;d=!this.R.isLeaf(f.Pa);k=g?l+b.pka+18:l;l=g?k-b.Nia:l+8;m=b.off.top-3;switch(t){case "before":case "first":this.bE(f.Fp,{left:k,top:m-7});f.wm&&this.bE(f.wm,{left:l,top:m});break;case "after":m+=r;this.bE(f.Fp,{left:k,top:m-2});f.wm&&this.bE(f.wm,{left:l,top:m+6});break;case "inside":this.bE(f.Fp,{left:k+(g?d?-4:0:4),top:b.off.top+r/2-8});f.wm&&f.wm.hide();break;default:this.Fy()}t?f.Pa.removeClass(e.nQ).addClass(e.bs):f.Pa.removeClass(e.bs).removeClass(e.bs);
return f.DZ=t};a.wa.prototype.Fy=function(){var a=this.Gd.Cf;a&&(a.Fp&&a.Fp.hide(),a.wm&&a.wm.hide(),a.Pa&&this.EC(a.Pa))};a.wa.prototype.bE=function(a,b){b.left+="px";b.top+="px";a.css(b).show()};a.wa.prototype.$sa=function(b,d,e){var f=this.Gd,g=f.Cf,k=a.wa;g.kc=b;g.kc.addClass(k.zH);f.lG=d.attr("id");try{e.currentTarget.unselectable="on",e.currentTarget.onselectstart=function(){return!1},e.currentTarget.style&&(e.currentTarget.style.MozUserSelect="none")}catch(l){}this.R.Iza()&&g.Fp&&g.Fp.addClass("oj-tree-"+
this.R.i.Oc.lB);b=this.R.Qa;f.NGa=b.offset();f.nHa=parseInt(b.width(),10);f.ch=parseInt(b.height(),10);f.pF=!0};a.wa.prototype.ata=function(){var b=this.Gd,d=b.Cf,e=a.wa;d.Pa&&this.EC(d.Pa);"number"!=typeof d.kc&&d.kc&&d.kc.removeClass(e.zH);this.UI&&(document.body.removeChild(this.UI),this.UI=null);b.pF=!1};a.wa.prototype.ADa=function(b,d){var e=this.Gd,f=a.wa,g,k;(g=this.R.N3(d))&&(k=JSON.stringify(g));if(e.Gw)for(g=0;g<e.Gw.length;g++)b.setData(e.Gw[g],k);b.setData(f.WP,"0");e.eO&&b.setData(f.XP,
"0")};a.wa.prototype.CDa=function(a,b){var e,f,h,k=b.length,l;if(1===k)this.UI=null;else{e=g("\x3cdiv\x3e\x3c/div\x3e");f=g("\x3cul style\x3d'padding:0px;margin:0;'\x3e\x3c/ul\x3e");e.append(f);for(l=0;l<k;l++)h=b[l].cloneNode(!0),h.style.marginLeft=0,h.style.paddingLeft=0,f.append(h);f=e[0];document.body.appendChild(f);f.style.position="absolute";f.style.top="-"+2*e.height()+"px";f.style.right="0";this.UI=f;a.setDragImage(f,0,0)}};a.wa.prototype.fV=function(a,b){var e=a.types,f=e.length,g;for(g=
0;g<f;g++)if(b==e[g])return!0;return!1};a.wa.prototype.L$=function(a){var b=this.Gd.zM,e=!1,f;if(b)for(e=!(0<b.length),f=0;f<b.length;f++){if(this.fV(a,b[f])){e=!0;break}}else e=!0;return e};a.wa.prototype.Tqa=function(b){var d=(b=b.types)&&b.length?b.length:0,e=a.wa,f=!1,g,k;for(k=0;k<d;k++)if(g=b[k],g!=e.WP&&g!=e.XP){f=!0;break}return f};a.wa.prototype.EC=function(b){var d=a.wa;b&&b.removeClass(d.bs).removeClass(d.nQ).removeClass(d.P2)};a.wa.prototype.pca=function(){var a={};this.Gd=a;a.reorder=
!1;a.eO=!1;a.qi=!1;a.pF=!1;a.lG=null;a.dx=null;a.AY=null;a.wY=null;a.uY=null;a.xY=null;a.zY=null;a.yY=null;a.vY=null;a.fj=!1;a.Fn=!1;a.oF=null;a.yM=null;a.INa=null;a.AM=null;a.CM=null;a.BM=null;a.JNa=null;a.zM=null;a.after=!1;a.BA=!1;a.before=!1;a.off=!1;a.cO=!1;a.Er=!1;a.NGa=!1;a.nHa=!1;a.ch=!1;a.Nia=100;a.pka=100;a.wKa=500;a.Cf={};a.Cf.kc=!1;a.Cf.Pa=!1;a.Cf.Fp=!1;a.Cf.wm=!1};a.wa.prototype.rea=function(a){this.R.rea(a)};a.wa.mQ="oj-draggable";a.wa.zH="oj-drag";a.wa.P2="oj-active-drop";a.wa.bs="oj-valid-drop";
a.wa.nQ="oj-invalid-drop";a.wa.HMa="oj-drop";a.wa.FMa="oj-tree-drop-marker";a.wa.Ona="oj-tree-drop-marker-line";a.wa.Jma="reorder";a.wa.Ama="drag";a.wa.Ema="drop";a.wa.W1="node";a.wa.V1="dataTypes";a.wa.Dma="dragStart";a.wa.Bma="drag";a.wa.Cma="dragEnd";a.wa.Fma="dragEnter";a.wa.Hma="dragOver";a.wa.Gma="dragLeave";a.wa.Ima="drop";a.wa.WP="_ojtree";a.wa.XP="_ojtreereorder";(function(){function c(a){q.push(a);g(a.Qca).keydown(d)}function d(b){var c="";a.D.qr(b)?c+="ctrl+":b.shiftKey&&(c+="shift+");
var d=b.which;switch(d){case 32:c+="space";break;case 37:c+="left";break;case 38:c+="up";break;case 39:c+="right";break;case 40:c+="down";break;case 46:c+="del";break;case 33:c+="pgup";break;case 34:c+="pgdn";break;case 35:c+="end";break;case 36:c+="home";break;case 56:c="*";break;case 113:case 121:c+="f"+(1-(112-d))}if(0===c.length||"shift+"==c||"ctrl+"==c)return!0;var e=null;g.each(q,function(a,d){if(d.SE.i.ui.dm)return d.SE.i.ui.qx=!1,"shift+f10"==c?d.SE.i.menu.dM=d.SE.i.ui.zc:d.R9[c]&&(b.preventDefault(),
e=d.R9[c].call(d.SE,b)),!1});if(null!=e)return e}function e(a){g.each(q,function(b){if(q[b].Qca===a)return g(a).off("keydown"),q[b]=null,q.splice(b,1),!1})}function f(a){var b=!0,c;for(c in a)if(a.hasOwnProperty(c)){b=!1;break}return b}function h(a){var b=!1,c=!0;a.sO&&(a.title&&(b=g("style[id\x3d'"+a.title+"-stylesheet']")[0]),b?c=!1:(b=document.createElement("style"),b.setAttribute("type","text/css"),a.title&&b.setAttribute("id",a.title+"-stylesheet")),b.styleSheet?c?(document.getElementsByTagName("head")[0].appendChild(b),
b.styleSheet.cssText=a.sO):b.styleSheet.cssText=b.styleSheet.cssText+" "+a.sO:(b.appendChild(document.createTextNode(a.sO)),document.getElementsByTagName("head")[0].appendChild(b)))}var k={cut:"ojtreecut",copy:"ojtreecopy",paste:"ojtreepaste","paste-after":"ojtreepasteafter","paste-before":"ojtreepastebefore",remove:"ojtreeremove",rename:"ojtreerename"},l={cut:"labelCut",copy:"labelCopy",paste:"labelPaste","paste-after":"labelPasteAfter","paste-before":"labelPasteBefore",remove:"labelRemove",rename:"labelRename"},
m="id title class role draggable style".split(" "),r,t,s;g(function(){/msie/.test(navigator.userAgent.toLowerCase())?(t=g('\x3ctextarea cols\x3d"10" rows\x3d"2"\x3e\x3c/textarea\x3e').css({position:"absolute",top:-1E3,left:0}).appendTo("body"),s=g('\x3ctextarea cols\x3d"10" rows\x3d"2" style\x3d"overflow: hidden;"\x3e\x3c/textarea\x3e').css({position:"absolute",top:-1E3,left:0}).appendTo("body"),r=t.width()-s.width(),t.add(s).remove()):(t=g("\x3cdiv /\x3e").css({width:100,height:100,overflow:"auto",
position:"absolute",top:-1E3,left:0}).prependTo("body").append("\x3cdiv /\x3e").find("div").css({width:"100%",height:200}),r=100-t.width(),t.parent().remove())});var q=[],p=-1;a.Ra("oj.ojTree",g.oj.baseComponent,{widgetEventPrefix:"oj",defaultElement:"\x3cdiv\x3e",options:{dnd:{reorder:"disable"},expandParents:!1,initExpanded:null,zJa:[],selection:[],selectionMode:"single",selectedParentCollapse:!1,selectedParentExpand:!0,selectPrevOnDelete:!1,data:null,emptyText:null,icons:!0,types:null,before:null,
collapse:null,create:null,collapseAll:null,cut:null,dehover:null,remove:null,destroy:null,expand:null,expandAll:null,hover:null,loaded:null,move:null,optionChange:null,paste:null,refresh:null,rename:null},collapse:function(a,c){var d=(c=c||!1)?0:this.hR;a=this.Ka(a);if(!a.length||-1===a||!a.hasClass(b.Gl)||this.i.la.locked||a.hasClass(b.Ye))return!1;var e=this.qc({obj:a,func:"collapse"},"before");if("boolean"!=typeof e||e)a.removeClass(b.Gl).addClass(b.Qh).attr("aria-expanded","false"),g(a.children()[0]).removeClass(b.Wm).addClass("oj-default"),
!c&&d?this.ep(a,!0):this.nX(g(a.children("UL")[0]),a)},ep:function(a,b){var c,d,e;c=g(a.children("ul"));this.caa?c[0].addEventListener("webkitTransitionEnd",this.YK):c[0].addEventListener("transitionend",this.YK);b?(d=c[0].offsetHeight,e=0):(d=0,e=this.Pua(c[0]));c.css("max-height",d+"px");c.css("overflow","hidden");b||(c[0].style.display="block");setTimeout(function(){c.addClass("oj-tree-transition");c.css("max-height",e+"px")},20)},Pua:function(a){var b,c,d,e,f=g("\x3cdiv style\x3d'position: absolute'\x3e");
b=a.parentNode;c=a.nextSibling;b.removeChild(a);e=a.style.display;a.style.display="block";f.append(a);this.Qa[0].appendChild(f[0]);d=a.offsetHeight||a.scrollHeight;a.style.display=e;this.Qa[0].removeChild(f[0]);f[0].removeChild(a);c?b.insertBefore(a,c):b.appendChild(a);return d+10},Sz:function(a){a=g(a.target);var b=a.closest("li");this.caa?a[0].removeEventListener("webkitTransitionEnd",this.YK):a[0].removeEventListener("transitionend",this.YK);a.removeClass("oj-tree-transition");this.nX(a,b)},nX:function(a,
c){c.hasClass(b.Qh)?(a[0].style.display="none",a.css("max-height",""),this.qc({obj:c},"collapse"),this.after_close(c)):(a[0].style.display="block",a.css("max-height",""),this.qc({obj:c},"expand"))},collapseAll:function(a,c){var d=a?a:-1,e=this;if(!this.i.la.locked&&((a=a?this.Ka(a):this.Qa)&&-1!==d&&(d=a),a&&-1!==d||(a=this.ra),!a.hasClass(b.Ye))){var f;-1!==d&&this.isExpanded(a)&&(f=a[0]);var g=a.find("li.oj-expanded");g.length&&g.each(function(){e.collapse(this,!c)});f&&(this.collapse(f,!c),g.splice(0,
0,f));g.length&&this.qc({obj:g,targ:d},"collapseAll")}},expand:function(a,b){this.cg(a,!1,b)},expanded:function(a,b){var c,d,e=this;if(a&&"array"===g.type(a)){if(this.i.la.locked)return null;d=a.length;g.each(a,function(a,c){e.cg(c,!1,b)});return null}a=this.ra.find("li.oj-expanded");d=a.length;c=[];for(var f=0;f<d;f++)c.push(a[f]);return g(c)},expandAll:function(a,b){this.MS(a,b)},toggleExpand:function(a,c){if((a=this.Ka(a))&&a.length&&-1!==a&&!a.hasClass(b.Ye)&&!this.i.la.locked){if(a.hasClass(b.Qh))return this.expand(a,
c);if(a.hasClass(b.Gl))return this.collapse(a,c)}},deselect:function(a){var b=this.options.selection.slice(0);this.lv(a);this.$C("selection",b,null,null)},deselectAll:function(a){if(!this.i.la.locked){var b=this.options.selection.slice(0);this.JI(a);this.$C("selection",b,null,null)}},select:function(a){this.yn(a,!0)},toggleSelect:function(a){a=this.Ka(a);if(!a.length||a.hasClass(b.Ye)||this.i.la.locked)return!1;this.Uk(a)?this.deselect(a):this.yn(a,!0);return!0},isCollapsed:function(a){return(a=this.Ka(a))&&
-1!==a&&a.hasClass(b.Qh)},isExpanded:function(a){return(a=this.Ka(a))&&-1!==a&&a.hasClass(b.Gl)},isLeaf:function(a){return this.iV(a)},isSelected:function(a){return this.Uk(a)},create:function(a,b,c){var d,e,f;e=g.isArray(c);if(!e||1==c.length)return d=this.MC(a,b,e?c[0]:c),this.Fo().SI(d),d;e=[];if("before"!=b)for(f=c.length-1;0<=f;f--)d=this.MC(a,b,c[f]),e.unshift(d[0]),this.Fo().SI(d);else for(f=0;f<c.length;f++)d=this.MC(a,b,c[f]),e.push(d[0]),this.Fo().SI(d);return g(e)},remove:function(a){a=
this.Ka(a);if(!a.length||a.hasClass(b.Ye)||this.i.la.locked)return!1;var c=this.qc({obj:a,func:"remove"},"before");if("boolean"==typeof c&&!c)return!1;this.bv();var c=this.ln(a),d=g([]),e=this,f=this.Dq(a);a.each(function(){d=d.add(e.Dq(this))});a=a.detach();-1!==c&&0===c.find("\x3e ul \x3e li").length&&c.removeClass("oj-expanded oj-collapsed").addClass("oj-tree-leaf").removeAttr("aria-expanded");this.Lj(c);this.qc({obj:a,prev:f,parent:c},"remove");return a},getText:function(a){a=this.Ka(a);if(!a.length)return!1;
a=a.children("a:eq(0)");a=a.find("span:eq(0)");return a[0].textContent},rename:function(a,b){this.ica(a,b)},hover:function(a){this.zya(a)},dehover:function(){this.o6()},getPath:function(a,b){var c=[],d=this;a=this.Ka(a);if(-1===a||!a||!a.length)return!1;a.parentsUntil(".oj-tree","li").each(function(){c.push(b?this.id:d.getText(this))});c.reverse();c.push(b?a.attr("id"):this.getText(a));return c},getRoot:function(){return this.Qa.children("ul:eq(0)")},refresh:function(a){this._super();this.i.la.locked||
this.Of(a?a:-1)},move:function(a,b,c,d){this.cE(a,b,c,d)},getType:function(a){return this.dU(a)},setType:function(a,b){return this.mEa(a,b)},getNodeBySubId:function(a){return a?this.EBa(a):this.element?this.element[0]:null},getSubIdByNode:function(a){return this.Uva(a)},getContextByNode:function(a){var b,c;a=this.Ka(null==a||void 0==a?0:a);b=-1!=a&&0<a.length;c=-1==a;return b||c?{subId:b?"oj-tree-node":"oj-tree",item:b?a[0]:null,node:b?a:!1,leaf:b?this.iV(a):!1}:null},getParent:function(a){return(a=
this.ln(a))&&0<a.length?a:null},getPrevSibling:function(a){return(a=this.Dq(a,!0))&&0<a.length?a:null},getNextSibling:function(a){return(a=this.zv(a,!0))&&0<a.length?a:null},getChildren:function(a){return(a=(a=this.vua(a?a:-1))&&a.length?a.not("."+b.by):a)&&0<a.length?a:null},scrollIntoView:function(a,b,c){a?(a=a.node,a=this.Ka(a)):a=-1;-1==a&&(a=this.Qa.find("\x3e ul \x3e li:first-child"));if(a&&a.length)return b="top"==b,c&&(this.ra.focus(),this.hover(a)),a[0].scrollIntoView(b),this},_ComponentCreate:function(){this._super();
this.Cya=this.JAa();this.nv=this.element.attr("id");void 0===this.nv&&(this.nv="oj-tree-"+this.Pj(),this.element.attr("id",this.nv));this.Qa=this.element;this.ra=null;this.i={};this.eea=null;this.BK="rtl"===this.nd();this.nz=a.D.jf();this.Sya();if(this.hR=this.lua())this.caa=a.Oa.er().browser===a.Oa.xk.qP,this.YK=this.Sz.bind(this);this.ak()},_destroy:function(){this.hra();this.i.html.VA&&(this.Qa.append(this.i.html.VA),this.i.html.VN.remove(),this.i.html.VN=!1,this.i.html.AO=!1);this.i.sb.type=0;
this._super()},_setOption:function(a,b,c){var d;if("selection"===a)b="string"==typeof b?[b]:b&&b.length?b:[],this.i.la.px=!0,this.dya(b),this.i.la.px=!1,b=this.QT();else if("selectionMode"===a)"none"===b?d=0:"single"===b?d=1:"multiple"===b?d=-1:(d=0,b="none"),d!=this.i.la.Kr&&(this.i.la.Kr=d);else if("icons"===a)"boolean"==g.type(b)&&b!=this.i.Oc.icons&&((this.i.Oc.icons=b)?this.QW():this.PU());else if("contextMenu"===a)this.gv(),b&&this.Ss(b);else if("disabled"===a)this.Gwa(b);else{if("data"===a){this._super(a,
b,c);this.n$();this.o$();this.q$();this.taa();return}if("dnd"===a){this._super(a,b,c);this.Fo().VIa();return}"emptyText"==a&&(b=this.$I(b))}this._super(a,b,c)},TB:function(a,b,c){return"selection"===a?this.z5(b,c):this._superApply(arguments)},z5:function(a,b){var c,d,e,f,h,k=!1,l=!1;f=a&&a.length?a.length:0;h=b&&b.length?b.length:0;if(f!==h)k=!0;else if(0==f&&0===h)k=!1;else for(c=0;c<f;c++){e=g(a[c]).attr("id");l=!1;for(d=0;d<h;d++)if(e==g(b[d]).attr("id")){l=!0;break}if(!l){k=!0;break}}return!k},
hra:function(){this.gC&&(this.gC.pra(),this.gC=null);var a=this.Pj();this.Qa.unbind(".oj-tree").undelegate(".oj-tree").removeData("oj-tree-instance-id").find("[class^\x3d'oj-tree']").addBack().attr("class",function(){return this.className.replace(/oj-tree[^ ]*|$/ig,"")});var b=this.Qa.attr("class"),b=b.trim();0===b.length&&this.Qa.removeAttr("class");e(this.ra);g(document).unbind(".oj-tree-"+a).undelegate(".oj-tree-"+a);this.ra.remove();this.ra=null},Ka:function(a,b){if("undefined"===typeof a||null===
a)return b?this.i.ui.selected:this.i.ui.Nc;var c=g(a,this.Qa);if(c.is(".oj-tree")||-1===a)return-1;c=c.closest("li",this.Qa);return c.length?c:!1},Dq:function(a,c){a=this.Ka(a);if(-1===a)return this.Qa.find("\x3e ul \x3e li:last-child");if(!a.length)return!1;if(c)return 0<a.prevAll("li").length?a.prevAll("li:eq(0)"):!1;if(a.prev("li").length){for(a=a.prev("li").eq(0);a.hasClass(b.Gl);)a=a.children("ul:eq(0)").children("li:last");return a}var d=a.parentsUntil(".oj-tree","li:eq(0)");return d.length?
d:!1},zv:function(a,c){a=this.Ka(a);return-1===a?this.Qa.find("\x3e ul \x3e li:first-child"):a.length?c?0<a.nextAll("li").length?a.nextAll("li:eq(0)"):!1:a.hasClass(b.Gl)?a.find("li:eq(0)"):0<a.nextAll("li").length?a.nextAll("li:eq(0)"):a.parentsUntil(".oj-tree","li").next("li").eq(0):!1},ln:function(a){a=this.Ka(a);if(-1==a||!a.length)return!1;a=a.parentsUntil(".oj-tree","li:eq(0)");return a.length?a:-1},vua:function(a){a=this.Ka(a);return-1===a?this.Qa.children("ul:eq(0)").children("li"):a.length?
a.children("ul:eq(0)").children("li"):!1},iV:function(a){return(a=this.Ka(a))&&-1!==a&&a.hasClass("oj-tree-leaf")},uva:function(a){a=this.ra.find(a);var b=!1;a&&a.length&&0<a.length&&g(a).is("li")&&(b=a);return b},Uk:function(a){a=this.Ka(a);var b=!1;a&&a.length&&this.i.ui.selected&&(b=0<=this.i.ui.selected.index(a));return b},RBa:function(b,c){var d=b.parents("div").eq(0);(d=a.Components.Yc(d))&&c&&d("getCI",c);return this},getCI:function(a){a.Rp=this},aqa:function(a,b){void 0!=a&&void 0!=b&&g.each(b,
function(b,c){void 0==a[b]&&(a[b]=c)})},Gwa:function(a){var c;"undefined"!==typeof a&&((c=this.ra.hasClass(b.Ye))||(c=!1),c!=a&&(a?(this.ra.addClass(b.Ye),this.ra.prop("disabled",!0)):(this.ra.removeClass(b.Ye),this.ra.prop("disabled",!1)),this.pFa(a)))},pFa:function(a){a?(this.i.la.locked=!0,this.i.ui.opacity=this.Qa.children("ul").css("opacity"),this.ra.addClass(b.Ye).css("opacity","0.9")):(this.i.la.locked=!1,this.ra.removeClass(b.Ye).css("opacity",this.i.ui.opacity))},pNa:function(){return this.i.la.locked},
dya:function(a){var b=a.slice(0),c=[],d=this,e,f,h,k;g.grep(b,function(a,f){if(e=d.uva(a))c.push(e),b[f]=e[0];else return!1;return!0});a=this.QT();g.each(a,function(a,b){k=c.length;f=g(b).attr("id");h=!1;for(a=0;a<k;a++)if(f==c[a].attr("id")){h=!0;break}h||d.lv(b)});this.hEa(c,null)},nE:function(a,b,c,d,e){var f={};b=-1!==b&&b?this.Ka(b):-1;this.RBa(a,f);f.fu=this;f.kc=f.Rp.Ka(a);f.Pa=b;f.Vn="undefined"===typeof c||!1===c?"last":c;if(!e&&this.i.la.tj.kc&&this.i.la.tj.kc[0]===f.kc[0]&&this.i.la.tj.Pa[0]===
f.Pa[0]&&this.i.la.tj.Vn===f.Vn)d&&d.call(this,this.i.la.tj);else{if(-1!==f.Pa&&f.Pa){if(!/^(before|after)$/.test(f.Vn)&&!this.Iq(f.Pa))return this.Jq(f.Pa,function(){this.nE(a,b,c,d,!0)});switch(f.Vn){case "before":f.Dn=f.Pa.index();f.Ew=f.fu.ln(f.Pa);break;case "after":f.Dn=f.Pa.index()+1;f.Ew=f.fu.ln(f.Pa);break;case "inside":case "first":f.Dn=0;f.Ew=f.Pa;break;case "last":f.Dn=f.Pa.find(" \x3e ul \x3e li").length;f.Ew=f.Pa;break;default:f.Dn=f.Vn,f.Ew=f.Pa}}else switch(f.Ew=-1,f.Vn){case "first":case "before":case "inside":f.Dn=
0;break;case "after":case "last":f.Dn=f.fu.Qa.find(" \x3e ul \x3e li").length;break;default:f.Dn=f.Vn}f.Ar=-1==f.Ew?f.fu.Qa:f.Ew;f.Dr=f.Rp.ln(f.kc);f.DNa=f.kc.index();-1===f.Dr&&(f.Dr=f.Rp?f.Rp.Qa:this.Qa);!/^(before|after)$/.test(f.Vn)&&f.Dr&&f.Ar&&f.Dr[0]===f.Ar[0]&&f.kc.index()<f.Dn&&f.Dn++;f.h_=f.Ar.find(" \x3e ul \x3e li:nth-child("+(f.Dn+1)+")");this.i.la.tj=f;d&&d.call(this,this.i.la.tj,"prepare_move")}},vI:function(){var a=this.i.la.tj,b=!0,c;c=-1===a.Pa?this.Qa:a.Pa;if(!a||!a.kc||a.h_[0]===
a.kc[0]||!a.Pa)return!1;if(!a.uM){if(a.Dr&&a.Ar&&a.Dr[0]===a.Ar[0]&&a.Dn-1===a.kc.index())return!1;a.kc.each(function(){if(-1!==c.parentsUntil(".oj-tree","li").addBack().index(this))return b=!1})}return b},ica:function(a,b){var c;a=this.Ka(a);this.bv();c=this.getText(a);if(a&&a.length){var d=this.qc({obj:a,func:"rename",title:b,prevTitle:c},"before");if("boolean"==typeof d&&!d)return}a&&a.length&&this.LW.apply(this,Array.prototype.slice.call(arguments))&&this.qc({obj:a,title:b,prevTitle:c},"rename")},
cE:function(a,c,d,e,f,h){f||(a=this.Ka(a));if(!(a.hasClass&&a.hasClass(b.Ye)||this.i.la.locked)){if(!f)return this.nE(a,c,d,function(a){a.Rp===a.fu||a.uM||a.Rp.deselect(a.kc);this.cE(a,!1,!1,e,!0,h)});e&&(this.i.la.tj.uM=!0);if(!h&&!this.vI())return!1;this.bv();c=!1;e?(c=a.kc.clone(!0),c.find("*[id]").addBack().each(function(){this.id&&(this.id="copy_"+this.id)})):c=a.kc;a.h_.length?a.h_.before(c):(a.Ar.children("ul").length||g("\x3cul /\x3e").appendTo(a.Ar),a.Ar.children("ul:eq(0)").append(c));try{a.Rp.Lj(a.Dr),
a.fu.Lj(a.Ar),a.Dr.find("\x3e ul \x3e li").length||a.Dr.removeClass("oj-expanded oj-collapsed").removeAttr("aria-expanded").addClass("oj-tree-leaf").children("ul").remove()}catch(k){}e&&(this.i.la.tj.uM=!0,this.i.la.tj.g_=c);c=g.extend(!0,{},this.i.la.tj);c.obj=a.kc;this.qc(c,"move");return this.i.la.tj}},$Ma:function(){return this.i.Oe.tj},dU:function(a){var b=null;this.options.types&&(b=this.Ka(a));return b&&b.length?b.attr(this.options.types.attr)||"default":!1},mEa:function(a,b){var c=this.options.types,
d,e=!1;a=this.Ka(a);c&&a&&-1!=a&&a.length&&b&&(d=c.attr,c=c.types,d&&c&&c[b]&&(a.attr(d,b),a.addClass("oj-tree-type"),e=!0));return e},Rqa:function(a,b){b=this.Ka(b);var c=!1,d=this.dU(b),e=this.Av().types,f=!1;if(-1===b)if(e[a])c=e[a];else return;else{if(!1===d)return;(f=this.i.types.Xc.useData?b.data("oj-tree"):!1)&&f.types&&"undefined"!==typeof f.types[a]?c=f.types[a]:e.types[d]&&"undefined"!==typeof e.types[d][a]?c=e.types[d][a]:e.types["default"]&&"undefined"!==typeof e.types["default"][a]&&
(c=e.types["default"][a])}g.isFunction(c)&&(c=c.call(this,b));return c},Lj:function(c){var d,e,f,h=this.Fo(),k=a.wa;h.uZ()&&(d=k.mQ,e="draggable",f=!0);h.KJa()&&(d+=" "+k.bs);c=c&&-1!=c?g(c):this.ra;c=c.is("li")?c.find("li").addBack():c.find("li");c.removeClass("oj-tree-last").addClass("oj-tree-node").addClass(d).attr(e,f).filter("li:last-child").addClass("oj-tree-last").end().filter(":has(li)").not(".oj-expanded").removeClass("oj-tree-leaf").addClass(b.Qh).attr("aria-expanded","false");c.not(".oj-expanded, .oj-collapsed").addClass("oj-tree-leaf").children("ul").remove();
var l=this.options.types?this.options.types.attr:!1;c.find("li");var m,p;g.each(c,function(){p=g(this);m=p.find("\x3e ins");1<m.length&&(m=g(m[0]));p.hasClass("oj-tree-leaf")?(m.removeClass("oj-tree-icon oj-tree-disclosure-icon oj-component-icon oj-clickable-icon-nocontext oj-default"),m.addClass("oj-tree-icon")):(m.addClass("oj-tree-icon oj-tree-disclosure-icon oj-component-icon oj-clickable-icon-nocontext oj-default"),m.removeClass("oj-tree-node-icon"));l&&p.attr(l)&&p.addClass("oj-tree-type")})},
MC:function(a,c,d,e,f){a=a||-1;a=this.Ka(a);if(-1!==a&&!a.length)return null;var h;c="undefined"===typeof c?"last":c;if(!f&&!this.Iq(a))return this.Jq(a,function(){this.MC(a,c,d,e,!0)}),null;this.bv();d=this.Mq(d);if(!d)return null;d=d.children();f=g(d[0]);-1===a&&(a=this.Qa,"before"===c&&(c="first"),"after"===c&&(c="last"));switch(c){case "before":a.before(f);h=this.ln(a);break;case "after":a.after(f);h=this.ln(a);break;case "inside":case "first":a.children("ul").length||a.append("\x3cul /\x3e");
a.children("ul").prepend(f);h=a;break;case "last":a.children("ul").length||a.append("\x3cul /\x3e");a.children("ul").append(f);h=a;break;default:a.children("ul").length||a.append("\x3cul /\x3e"),c||(c=0),h=a.children("ul").children("li").eq(c),h.length?h.before(f):a.children("ul").append(f),h=a}if(-1===h||h.get(0)===this.Qa.get(0))h=-1;this.Lj(h);this.qc({obj:f,parent:h},"create");e&&e.call(this,f);1<this.ra[0].childNodes.length&&this.ra.find("."+b.by).remove();return f},cg:function(a,c,d){a=this.Ka(a);
if(!a||!a.length)return!1;d=d||!1;if(!a.hasClass(b.Ye)&&!this.i.la.locked){if(!a.hasClass(b.Qh))return c&&c.call(),!1;var e=this.qc({obj:a,func:"expand"},"before");if("boolean"!=typeof e||e){var e=d?0:this.hR,f=this;this.Iq(a)?(this.options.expandParents&&a.parentsUntil(".oj-tree",".oj-collapsed").each(function(){f.cg(this,!1,!0)}),a.removeClass(b.Qh).addClass(b.Gl).attr("aria-expanded","true").children("a").removeClass("oj-tree-loading"),g(a.children()[0]).removeClass(b.Wm).addClass("oj-default"),
!d&&e?this.ep(a,!1):this.nX(g(a.children("UL")[0]),a),c&&c.call()):(a.children("a").addClass("oj-tree-loading"),this.Jq(a,function(){f.cg(a,c,d)},c))}}},MS:function(a,b,c){var d=a?a:-1;(a=a?this.Ka(a):-1)&&-1!==a?d=a:a=this.ra;c?a=a.find("li.oj-collapsed"):(c=a,a=a.is(".oj-collapsed")?a.find("li.oj-collapsed").addBack():a.find("li.oj-collapsed"));var e=this;a.each(function(){var a=this;e.Iq(this)?e.cg(this,!1,!b):e.expand(this,function(){e.MS(a,b,c)},!b)});0===c.find("li.oj-collapsed").length&&this.qc({obj:a,
targ:d},"expandAll")},yn:function(c,d,e){var f=this.i.la,g=this.i.ui,h=f.Kr;if(0==h)return!1;c=this.Ka(c);if(-1==c||!c||!c.length||c.hasClass(b.Ye)||f.locked)return!1;e&&"touchend"==e.type||(g.qx=!1);var k=this.Uk(c);if(!k){var l=this.qc({obj:c,func:"select"},"before");if("boolean"==typeof l&&!l)return!1}var l=this.options.selection.slice(0),m=this.options,p=g.Xc.selectMultipleModifier,q=g.Xc.selectRangeModifier,r=g.Xc.disableSelectingChildren,p="on"==p||!1!==p&&e&&a.D.qr(e),q=!1!==q&&e&&e[q+"Key"]&&
g.Nc&&this.i.ui.Nc[0]!==c[0]&&g.Nc.parent()[0]===c.parent()[0],s=!0,t=this;if(d){if(r&&p&&(c.parentsUntil(".oj-tree","li").children("a.oj-selected").length||c.children("ul").find("a.oj-selected:eq(0)").length))return!1;s=!1;switch(!0){case q:g.Nc.addClass("oj-tree-last-selected");c=c[c.index()<g.Nc.index()?"nextUntil":"prevUntil"](".oj-tree-last-selected").addBack();-1==h||c.length<h?(g.Nc.removeClass("oj-tree-last-selected"),g.selected.each(function(){this!==g.Nc[0]&&t.lv(this)}),k=!1,s=!0):s=!1;
break;case g.qx&&-1==h:g.qx=!1;this.toggleSelect(c);s=!1;break;case k&&!p:if(!e)break;this.JI();g.H_||(k=!1);s=!0;break;case !k&&!p:e?g.selected&&1==g.selected.length?this.lv(g.selected):this.JI(g.selected):1===h?this.lv(g.selected):1<h&&this.JI();s=!0;break;case k&&p:this.deselect(c);break;case !k&&p:if(-1==h||g.selected.length+1<=h)s=!0}}d=!1;s&&!k&&(q||(g.Nc=c),c.children("a").addClass(b.Wm),c.attr("aria-selected","true"),d=!0,m.selectedParentExpand&&c.parents(".oj-collapsed").each(function(){t.cg(this,
!1,!0)}),g.selected=g.selected.add(c),this.j7(c.eq(0)),f.px||this.$C("selection",l,null,e));return d},lv:function(a){a=this.Ka(a);if(!a.length)return!1;a.hasClass(b.Ye)||this.i.la.locked||!this.Uk(a)||(a.children("a").removeClass(b.Wm),a.removeAttr("aria-selected"),this.i.ui.selected=this.i.ui.selected.not(a),this.i.ui.Nc&&this.i.ui.Nc.length&&this.i.ui.Nc.get(0)===a.get(0)&&(this.i.ui.Nc=this.i.ui.selected.eq(0)))},JI:function(a){if(!this.i.la.locked&&(a=a?g(a).find("a.oj-selected").parent():this.Qa.find("a.oj-selected").parent(),
a.not(".oj-disabled"),0!==a.length)){var b=this;g.each(a,function(){b.lv(this)})}},hEa:function(a,b){if(this.i.la.locked)return null;if(a&&0<a.length){var c=this;g.each(a,function(a,d){d&&c.yn(d,!0,b)})}},J9:function(a){a.preventDefault();a.currentTarget.blur();if(!g(a.currentTarget).hasClass("oj-tree-loading")){this.Zj();if(!this.i.ui.dm){var b=this.Ka(a.currentTarget);0<b.length&&-1!=b&&(this.i.ui.jk=b);this.ra.focus()}this.yn(a.currentTarget,!0,a)}this.i.ui.qx=!1},A6:function(a,c){a=g(a);if(!a.hasClass(b.Ye)&&
!this.i.la.locked){var d=a.parent(),e=d.hasClass(b.Qh);if(d.hasClass(b.Gl)||e)c?(a.addClass(b.Su),a.removeClass("oj-default"),a.removeClass(b.Wm)):(a.removeClass(b.Su),a.addClass("oj-default"))}},zya:function(a){if(!this.i.menu.dM&&(a=this.Ka(a),a.length&&!a.hasClass(b.Ye)&&!this.i.la.locked&&!a.hasClass(b.Su))){var c=this.qc({obj:a,func:"hover"},"before");if("boolean"!=typeof c||c)a.hasClass(b.Su)||this.o6(),this.i.ui.zc=a.children("a").addClass(b.Su).parent(),this.ra.attr("aria-activedescendant",
this.i.ui.zc.attr("id")),this.j7(a),this.qc({obj:a},"hover")}},o6:function(){if(!this.i.menu.dM){var a=this.i.ui.zc,c;if(a&&a.length&&!a.hasClass(b.Ye)&&!this.i.la.locked){c=a.find("a.oj-hover");if(!c.length&&(c=this.ra.find("a.oj-hover"),!c.length))return;c.removeClass(b.Su).parent();this.ra.removeAttr("aria-activedescendant");this.i.ui.zc=null;void 0!=a.attr("id")&&this.qc({obj:a},"dehover")}}},Of:function(a){this.Tba(a)},Tba:function(a){var b=a?a:-1,c=this;this.lDa();a||(a=-1);(a=this.Ka(a))?b=
a:a=-1;-1!==a?a.children("UL").remove():(this.ra.empty(),this.qba());this.Jq(a,function(){c.qc({obj:b},"refresh");c.eL();c.hCa()})},gW:function(a){this.saveSelected();this.Tba(a)},after_close:function(a){this.qc({obj:a},"after_close",!0)},PCa:function(){var a=this;this.i.la.uj.length&&g.each(this.i.la.uj,function(b,c){a.cg(c,!1,!0)});this.qc({},"reopen",!0)},hCa:function(){var a,b=this.i.ui.jk;b&&(a=b.attr("id"))&&(b=this.Ka("#"+a));this.i.ui.zc=this.i.ui.jk=b},QT:function(a){var b,c,d;a=a?g(a).find("a.oj-selected").parent():
this.i.ui.selected;b=[];d=a.length;for(c=0;c<d;c++)b.push(a[c]);return b},LW:function(a,b){a=this.Ka(a);if(!a.length)return!1;a=a.children("a:eq(0)");a=a.find("span:eq(0)");this.qc({obj:a,name:b},"set_text",!0);return a[0].textContent=b},taa:function(){0!==this.i.sb.type&&-1!==this.i.sb.type?this.Jq(-1,function(){this.vaa();this.eL()}):(this.bqa(),this.vaa())},Jq:function(a){this.qc({obj:a},"load_node",!0)},Iq:function(){return!0},bAa:function(a,b,c){var d=this;this.eAa(a,function(){d.qc({obj:d.Ka(a)},
"load_node",!0);b.call(this)},c)},Kza:function(a){a=this.Ka(a);return-1===a||!a||a.is(".oj-expanded, .oj-tree-leaf")||0<a.children("ul").children("li").length},$Ba:function(a){(a=this.Ka(a))&&-1!==a&&a.removeData("oj-tree-children");return this.gW(a)},dAa:function(a,b,c){var d=this;this.aAa(a,function(){d.qc({obj:d.Ka(a)},"load_node",!0);b.call(this)},c)},Mza:function(a){var b=this.options.data;a=this.Ka(a);return-1==a||!a||!b.ajax&&!this.i.sb.o_&&!g.isFunction(b.data)||a.is(".oj-expanded, .oj-tree-leaf")||
0<a.children("ul").children("li").length},cAa:function(a,b,c){var d=this;this.$za(a,function(){d.qc({obj:d.Ka(a)},"load_node",!0);b.call(this)},c)},Lza:function(a){var b=this.options.data,c=null,d=null;b&&(c=b.data||null,d=b.ajax||null);a=this.Ka(a);return-1==a||!a||!d&&!g.isFunction(c)||a.is(".oj-expanded, .oj-tree-leaf")||0<a.children("ul").children("li").length},reselect:function(){var a=this,b=this.i.ui.yG,b=g.map(g.makeArray(b),function(a){return"#"+a.toString().replace(/^#/,"").replace(/\\\//g,
"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});g.each(b,function(b,c){c&&"#"!==c&&a.select(c)});this.i.ui.selected=this.i.ui.selected.filter(function(){return this.parentNode});this.qc(null,"reselect",!0)},saveSelected:function(){var a=this.i.ui;a.yG=[];a.selected.each(function(){this.id&&a.yG.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"))});this.qc(a.yG,
"savedselected",!0)},rollback:function(a){a&&g.isArray(a)},get_rollback:function(){this.qc(null,"get_rollback",!0);return{RNa:this.Pj(),ik:this.Qa.children("ul").clone(!0),ENa:this.data}},eAa:function(a,b){var c=this.s2(a&&-1!=a?a[0].id:a?a:-1,a);if(c.success){var d=!a||-1===a,e=this.options.data;if(e.data&&!e.ajax||e.data&&e.ajax&&d)d&&((c=this.Mq(c.rN,a))?(this.ra.empty().append(c.children()),this.Lj()):this.i.sb.ej&&this.ra.empty()),b&&b.call(this);else if(!e.data&&e.ajax||e.data&&e.ajax&&!d)(c=
this.Mq(c.rN,a))?(d?(d=this.ra,d.empty().append(c.children()),d.attr("role","tree").attr("aria-labelledby",this.nv).attr("tabindex","0").css("outline","none"),-1===this.i.la.Kr&&d.attr("aria-multiselectable",!0)):(a.append(c).children("a.oj-tree-loading").removeClass("oj-tree-loading"),a.removeData("oj-tree-is-loading")),this.Lj(a),b&&b.call(this)):d?this.i.sb.ej&&(this.ra.empty(),b&&b.call(this)):(a.children("a.oj-tree-loading").removeClass("oj-tree-loading"),a.removeData("oj-tree-is-loading"),e.correct_state&&
(this.jv(a),b&&b.call(this)))}},s2:function(a,b){var c=[],d=this.eea,e,f={},g={success:!1,rN:null};-1==a&&(a=null,f.start=0);e=d.getChildCount(a);0<e?(f.count=e,d.fetchChildren(a,f,{success:function(a){for(var e=a.getCount(),f,h=0;h<e;h++){b={};(f=a.getData(h))&&(b.attr=f);b.title=a.Bi[h].title;f.WNa&&(b.metadata=a.Bi[h].metadata);var k=b.attr.id;f=d.getChildCount(k);0<f&&(f=this.s2(k,b),b.children=f.rN);c.push(b)}g.success=!0;g.rN=c}.bind(this),error:function(){g.success=!1}})):g.success=!0;return g},
aCa:function(a){a=this.Ka(a);if(!this.i.la.locked){var c=!a||-1!==a||!a.length;if(c||!a.hasClass(b.Ye)){var d=this.options.data.json;!c&&this.i.sb.dB&&(g.isFunction(d.data)||d.ajax)&&a.removeData("oj-tree-children");return this.gW(a)}}},aAa:function(a,b,c){function d(){}function e(){}var f=this.Av().data,h=f&&f.data||null,k=f&&f.ajax||null;!f||h||k||(h=f);if((a=this.Ka(a))&&-1!==a&&(this.i.sb.o_||this.i.sb.dB)&&!a.is(".oj-expanded, .oj-tree-leaf")&&0===a.children("ul").children("li").length&&a.data("oj-tree-children")){if(f=
this.Mq(a.data("oj-tree-children"),a))a.append(f),this.i.sb.dB||a.removeData("oj-tree-children");this.Lj(a);b&&b.call(this)}else{if(a&&-1!==a){if(a.data("oj-tree-is-loading"))return;a.data("oj-tree-is-loading",!0)}switch(!0){case !h&&!k:throw"ojTree - neither data nor ajax settings supplied.";case g.isFunction(h):h.call(this,a,function(d){(d=this.Mq(d,a))?(-1!==a&&a?(a.append(d).children("a.oj-tree-loading").removeClass("oj-tree-loading"),a.removeData("oj-tree-is-loading")):this.ra.empty().append(d.children()),
this.Lj(a),b&&b.call(this)):(-1!==a&&a?(a.children("a.oj-tree-loading").removeClass("oj-tree-loading"),a.removeData("oj-tree-is-loading"),this.i.sb.ej&&this.jv(a)):this.i.sb.ej&&this.ra.empty(),c&&c.call(this))}.bind(this));break;case !!h&&!k||!!h&&!!k&&(!a||-1===a):a&&-1!=a||((f=this.Mq(h,a))?(this.ra.empty().append(f.children()),this.Lj()):this.i.sb.ej&&this.ra.empty());b&&b.call(this);break;case !h&&!!k||!!h&&!!k&&a&&-1!==a:e=function(b,d,e){var f=this.Av().data.ajax.error;f&&f.call(this,d,e,b);
-1!=a&&a.length?(a.children("a.oj-tree-loading").removeClass("oj-tree-loading"),a.removeData("oj-tree-is-loading"),"success"===d&&this.i.sb.ej&&this.jv(a)):("error"==d||"success"===d&&this.i.sb.ej)&&this.ra.empty();c&&c.call(this)},d=function(c,d,f){var g=this.Av().data.ajax.success;g&&(c=g.call(this,c,d,f)||c);if("string"==typeof c){d=c.replace(/^[\s\n]+$/,"");try{d=JSON.parse(d)}catch(h){d=null}if(!d)return e.call(this,f,"Bad JSON","")}(c=this.Mq(c,a))?(-1!==a&&a?(a.append(c).children("a.oj-tree-loading").removeClass("oj-tree-loading"),
a.removeData("oj-tree-is-loading")):(f=this.ra,f.empty().append(c.children()),f.attr("role","tree").attr("aria-labelledby",this.nv).attr("tabindex","0").css("outline","none"),-1===this.i.la.Kr&&f.attr("aria-multiselectable",!0)),this.Lj(a),b&&b.call(this)):-1!==a&&a?(a.children("a.oj-tree-loading").removeClass("oj-tree-loading"),a.removeData("oj-tree-is-loading"),this.i.sb.ej&&(this.jv(a),b&&b.call(this))):this.i.sb.ej&&(this.ra.empty(),b&&b.call(this))},f.ajax.context=this,f.ajax.error=e,f.ajax.success=
d,f.dataType||(f.ajax.dataType="json"),g.isFunction(f.ajax.url)&&(f.ajax.url=f.ajax.url.call(this,a)),g.isFunction(f.ajax.data)&&(f.ajax.data=f.ajax.data.call(this,a)),g.ajax(f.ajax)}}},Mq:function(a,c,d){var e=!1,f,h,k,l;if(!a)return e;this.i.sb.dB&&c&&-1!==c&&c.data("oj-tree-children",e);if("string"==typeof a)try{a=JSON.parse(a)}catch(m){a=[]}if(g.isArray(a)){e=g("\x3cul\x3e");if(!a.length)return!1;h=0;for(k=a.length;h<k;h++)f=this.Mq(a[h],c,!0),f.length&&(e=e.append(f));e=e.children()}else{"string"==
typeof a&&(a={data:a});l="string"==typeof a.title?a.title:" ";e=g("\x3cli role\x3d'treeitem' /\x3e");a.attr&&(this.i.types.fA&&!a.attr.type&&(a.attr.type="oj-tree-deftype",e.addClass("oj-tree-type")),e.attr(a.attr));a.metadata&&e.data(a.metadata);a.children&&0===a.children.length&&e.addClass(b.Qh);a.state&&"s"===a.state&&e.addClass(b.Wm);a.data||(a.data={dummy:0});var p=!1,q;f=g("\x3ca tabindex\x3d'-1' /\x3e");g.each(a.data,function(b,c){g.isFunction(c)&&(c=c.call(this,a));"object"===typeof c&&("attr"==
b?f.attr(c):"style"==b&&f.css(c),"language"==b&&f.addClass(c));p||(q=g("\x3cspan class\x3d'oj-tree-title'\x3e"),q[0].textContent=l,f.prepend("\x3cins class\x3d'oj-tree-icon oj-tree-node-icon oj-component-icon'\x3e\x26#160;\x3c/ins\x3e",q),p=!0);!c.icon&&a.icon&&(c.icon=a.icon);c.icon&&(-1===c.icon.indexOf("/")?f.children("ins").addClass(c.icon):f.children("ins").css("background","url('"+c.icon+"') center center no-repeat"))});e.append(f);e.prepend("\x3cins class\x3d'oj-tree-icon oj-tree-disclosure-icon oj-component-icon oj-clickable-icon-nocontext oj-default'\x3e\x26#160;\x3c/ins\x3e");
a.children&&(this.i.sb.o_&&"expanded"!==a.state?e.addClass(b.Qh).attr("aria-expanded","false").data("oj-tree-children",a.children):(this.i.sb.dB&&e.data("oj-tree-children",a.children),g.isArray(a.children)&&a.children.length&&(f=this.Mq(a.children,c,!0),f.length&&(c=g("\x3cul role\x3d'group' /\x3e"),c.append(f),e.append(c)))))}d||(d=g("\x3cul /\x3e"),d.append(e),e=d);return e},N3:function(a,b,c,d){var e=[],h=this.options,k=this,l,m,p,q,r,s,t,J,D;(a=this.Ka(a))&&-1!==a||(a=this.Qa.find("\x3e ul \x3e li"));
b=g.isArray(b)?b:["id","class"];!d&&h.types&&b.push(h.types.attr);c=g.isArray(c)?c:[];a.each(function(){q=g(this);l={};D=k.RAa(q);if(b.length||D&&D.length)l.attr={};D&&g.each(D,function(a,b){0<q.attr(b).length&&(l.attr[b]=q.attr(b))});g.each(b,function(a,b){(m=q.attr(b))&&m.length&&m.replace(/oj-tree[^ ]*/ig,"").length&&(m=(" "+m).replace(/ oj-tree[^ ]*/ig,"").replace(/ oj-[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""),m.length&&(l.attr[b]=m))});k.Fo().uZ()&&k.Uk(q)&&(l.state=
"s");p=q.data();f(p)||(l.metadata=p);r=q.children("a");m=null;r.each(function(){s=g(this);c.length||s.children("ins").get(0).style.backgroundImage.length||s.children("ins").get(0).className&&s.children("ins").get(0).className.replace(/oj-tree[^ ]*|$/ig,"").length?(J=k.getText(s),g.each(c,function(a,b){t=(" "+(s.attr(b)||"")).replace(/ oj-tree[^ ]*/ig,"").replace(/ oj-[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");t.length&&(m||(m={attr:{}}),m.attr[b]=t)}),s.children("ins").get(0).className.replace(/oj-tree[^ ]*|$/ig,
"").replace(/^\s+$/ig,"").length&&(t=s.children("ins").get(0).className.replace(/oj-tree[^ ]*|$/ig,"").replace(/ oj-[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""),t.length&&(m||(m={}),m.icon=t)),s.children("ins").get(0).style.backgroundImage.length&&(t=s.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")",""),t.length&&(m||(m={}),m.icon=t))):J=k.getText(s);null!=m&&(l.data||(l.data=[]),1<r.length?l.data.push(m):l.data=m);l.title=J});q=q.find("\x3e ul \x3e li");
q.length&&(l.children=k.N3(q,b,c,!0));e.push(l)});return e},RAa:function(a){var b,c,d;if((a=a[0].attributes)&&a.length){c=[];d=m.length;for(var e=0;e<a.length;e++)if(b=a[e]){b=b.name;for(var f=0;f<d&&m[f]!=b&&0!=b.indexOf("aria-");f++);f>=d&&c.push(b)}}return c&&0<c.length?c:null},jv:function(a){a=this.Ka(a);if(!a||-1===a)return!1;a.removeClass("oj-collapsed oj-expanded").removeAttr("aria-expanded").addClass("oj-tree-leaf").children("ul").remove();a.find("ins:first-child").removeClass("oj-tree-icon oj-tree-disclosure-icon oj-component-icon oj-clickable-icon-nocontext oj-default").addClass("oj-tree-icon");
this.qc({obj:a},"correct_state",!0)},vaa:function(){this.qc(null,"loaded")},$za:function(a,b,c){function d(){}function e(){}var f=this.Av().data,h=f&&f.data||null,k=f&&f.ajax||null;if((a=this.Ka(a))&&-1!==a){if(a.data("oj-tree-is-loading"))return;a.data("oj-tree-is-loading",!0)}switch(!0){case !h&&!k&&f&&"string"===typeof f:this.saa(f,a,b,c);break;case g.isFunction(h):h.call(this,a,function(d){this.saa(d,a,b,c)}.bind(this));break;case !h&&!k:a&&-1!=a||(this.ra.empty().append(this.i.html.mM).find("li, a").filter(function(){return!this.firstChild||
!this.firstChild.tagName||"INS"!==this.firstChild.tagName}).prepend("\x3cins class\x3d'oj-tree-icon' \x3e\x26#160;\x3c/ins\x3e").end().filter("a").children("ins:first-child").not(".oj-tree-node-icon").addClass("oj-tree-node-icon").addClass("oj-tree-icon"),this.ra.find("li").children("ins:first-child").addClass("oj-tree-icon oj-tree-disclosure-icon oj-component-icon oj-clickable-icon-nocontext oj-default"),this.qK(this.ra),this.i.types.fA&&this.oC(this.ra),this.Lj(),this.ra.find("ul").attr("role",
"group"),this.ra.find("li").attr("role","treeitem"),this.ra.find("a").attr("tabindex",-1));b&&b.call(this);break;case !!h&&!k||!!h&&!!k&&(!a||-1===a):a&&-1!=a||(f=g(h),f.is("ul")||(f=g("\x3cul /\x3e").append(f)),this.ra.empty().append(f.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||"INS"!==this.firstChild.tagName}).prepend("\x3cins class\x3d'oj-tree-icon'\x3e\x26#160;\x3c/ins\x3e").end().filter("a").children("ins:first-child").not(".oj-tree-node-icon").addClass("oj-tree-node-icon").addClass("oj-tree-icon"),
this.ra.find("li.oj-tree-leaf ins:first-child").removeClass("oj-tree-icon oj-tree-disclosure-icon oj-component-icon oj-clickable-icon-nocontext oj-default").removeClass("oj-tree-node-icon").addClass("oj-tree-icon"),this.qK(this.ra),this.i.types.fA&&this.oC(this.ra),this.Lj(),this.ra.find("ul").attr("role","group"),this.ra.find("li").attr("role","treeitem"),this.ra.find("a").attr("tabindex","-1"));b&&b.call(this);break;case !h&&!!k||!!h&&!!k&&a&&-1!==a:a=this.Ka(a),e=function(b,d,e){var f=this.Av().data.ajax.error;
f&&f.call(this,b,d,e);-1!=a&&a.length?(a.children("a.oj-tree-loading").removeClass("oj-tree-loading"),a.removeData("oj-tree-is-loading"),"success"===d&&this.i.sb.ej&&this.jv(a)):"success"===d&&this.i.sb.ej&&this.ra.empty();c&&c.call(this)},d=function(c,d,f){var h=this.Av().data.ajax.success;h&&(c=h.call(this,c,d,f)||c);if(""===c||c&&c.toString&&""===c.toString().replace(/^[\s\n]+$/,""))return e.call(this,f,d,"");if(c){c=g(c);c.is("ul")||(c=g("\x3cul /\x3e").append(c));-1!=a&&a?(a.children("a.oj-tree-loading").removeClass("oj-tree-loading"),
this.rCa(a),a.append(c).children("ul").find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||"INS"!==this.firstChild.tagName}).prepend("\x3cins class\x3d'oj-tree-icon'\x3e\x26#160;\x3c/ins\x3e").end().filter("a").children("ins:first-child").not(".oj-tree-node-icon").addClass("oj-tree-node-icon").addClass("oj-tree-icon"),a.removeData("oj-tree-is-loading"),a.find("li.oj-tree-leaf ins:first-child").removeClass("oj-tree-icon oj-tree-disclosure-icon oj-component-icon oj-clickable-icon-nocontext oj-default").removeClass("oj-tree-node-icon").addClass("oj-tree-icon"),
c=a):(this.ra.empty().append(c.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||"INS"!==this.firstChild.tagName}).prepend("\x3cins class\x3d'oj-tree-icon'\x3e\x26#160;\x3c/ins\x3e").end().filter("a").children("ins:first-child").not(".oj-tree-node-icon").addClass("oj-tree-node-icon").addClass("oj-tree-icon"),this.ra.find("li.oj-tree-leaf ins:first-child").removeClass("oj-tree-icon oj-tree-disclosure-icon oj-component-icon oj-clickable-icon-nocontext oj-default").removeClass("oj-tree-node-icon").addClass("oj-tree-icon"),
c=this.ra);this.kxa(c);this.qK(c);d=c.children("UL");if(1<=d.length){d=d.first().find("span.oj-tree-title");var k=this;g.each(d,function(){this.textContent=k.$I(this.textContent)})}this.i.types.fA&&c&&this.oC(this.ra);this.Lj(a);b&&b.call(this)}else a&&-1!==a?(a.children("a.oj-tree-loading").removeClass("oj-tree-loading"),a.removeData("oj-tree-is-loading"),this.i.sb.ej&&(this.jv(a),b&&b.call(this))):this.i.sb.ej&&(this.ra.empty(),b&&b.call(this)),this.ra.find("ul").attr("role","group"),this.ra.find("li").attr("role",
"treeitem")},f.ajax.context=this,f.ajax.error=e,f.ajax.success=d,f.ajax.dataType||(f.ajax.dataType="html"),g.isFunction(f.ajax.url)&&(f.ajax.url=f.ajax.url.call(this,a)),g.isFunction(f.ajax.data)&&(f.ajax.data=f.ajax.data.call(this,a)),g.ajax(f.ajax)}},kxa:function(a){a=a.find(a.is("ul")?"li ul":"ul").filter(function(){return!this.firstChild||0==this.childNodes.length||1==this.childNodes.length&&3==this.firstChild.nodeType});g.each(a,function(){g(this).closest("li").addClass(b.Qh)})},rCa:function(a){a=
a.find("ul").filter(function(){return!this.firstChild||0==this.childNodes.length||1==this.childNodes.length&&3==this.firstChild.nodeType});0<a.length&&a.remove()},saa:function(a,b,c){if(a&&""!==a&&a.toString&&""!==a.toString().replace(/^[\s\n]+$/,"")){a=g(a);a.is("ul")||(a=g("\x3cul /\x3e").append(a));-1!=b&&b?(b.children("a.oj-tree-loading").removeClass("oj-tree-loading"),b.append(a).children("ul").find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||"INS"!==this.firstChild.tagName}).prepend("\x3cins class\x3d'oj-tree-icon'\x3e\x26#160;\x3c/ins\x3e").end().filter("a").children("ins:first-child").not(".oj-tree-node-icon").addClass("oj-tree-node-icon").addClass("oj-tree-icon"),
b.removeData("oj-tree-is-loading"),a=b,this.oC(this.dOa)):(this.ra.empty().append(a.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||"INS"!==this.firstChild.tagName}).prepend("\x3cins class\x3d'oj-tree-icon oj-tree-disclosure-icon'\x3e\x26#160;\x3c/ins\x3e").end().filter("a").children("ins:first-child").not(".oj-tree-node-icon").addClass("oj-tree-node-icon").addClass("oj-tree-icon"),this.ra.find("li.oj-tree-leaf ins:first-child").removeClass("oj-tree-icon oj-tree-disclosure-icon oj-component-icon oj-clickable-icon-nocontext oj-default").removeClass("oj-tree-node-icon").addClass("oj-tree-icon"),
a=this.ra,this.oC(this.ra));a&&this.qK(a);a=a.children("UL");if(1<=a.length){a=a.first().find("span.oj-tree-title");var d=this;g.each(a,function(){this.textContent=d.$I(this.textContent)})}this.Lj(b);c&&c.call(this)}else b&&-1!==b?(b.children("a.oj-tree-loading").removeClass("oj-tree-loading"),b.removeData("oj-tree-is-loading"),this.i.sb.ej&&(this.jv(b),c&&c.call(this))):this.i.sb.ej&&(this.ra.empty(),c&&c.call(this))},qK:function(a){g.each(a.find("li a"),function(a,b){var c=b.innerHTML,c=c.replace("ins\x3e",
"ins\x3e\x3cspan class\x3d'oj-tree-title'\x3e");b.innerHTML=c+"\x3c/span\x3e"})},oC:function(a){var b,c;this.i.types.fA&&(c=(b=this.options.types)?b.attr:this.i.types.Xc.attr,g.each(a.find("li"),function(a,b){b=g(b);b.attr(c)||b.attr(c,"oj-tree-deftype").addClass("oj-tree-type")}))},lDa:function(){var a=this;this.i.la.uj=[];this.ra.find("li.oj-expanded").each(function(){this.id&&a.i.la.uj.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,
"\\.").replace(/\:/g,"\\:"))})},eL:function(a){var b=this,c=!0,d=[],e=[],f,h;a||(this.i.la.r_=!1,this.i.la.LKa=!0);this.Dza()&&(this.i.la.uj=[],this.ra.find("li.oj-collapsed").each(function(){h="#"+g(this).attr("id");b.isExpanded(h)||b.i.la.uj.push(h)}));this.i.la.uj=g.map(g.makeArray(this.i.la.uj),function(a){return"#"+a.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});this.i.la.Sp=g.map(g.makeArray(this.i.la.Sp),
function(a){return"#"+a.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});this.i.la.uj.length&&(this.i.la.Sp=this.i.la.Sp.concat(this.i.la.uj),this.i.la.Sp=this.i.la.Sp.reduce(function(a,b){0>a.indexOf(b)&&a.push(b);return a},[]));this.i.la.Sp.length&&(g.each(this.i.la.Sp,function(a,c){if("#"==c)return!0;f=b.Qa.find(c);f.length?b.isExpanded(c)||d.push(c):e.push(c)}),d.length&&(this.i.la.Sp=e,g.each(d,function(a,d){b.Iq(d)||
(b.Jq(d,function(){b.eL(!0)},function(){b.eL(!0)}),c=!1)})));this.i.la.uj.length&&g.each(this.i.la.uj,function(a,c){b.isExpanded(c)||b.cg(c,!1,!0)});c&&(this.i.la.r_&&clearTimeout(this.i.la.r_),this.i.la.r_=setTimeout(function(){b.qc({},"reload_nodes",!0)},50),this.i.la.LKa=!1,this.PCa())},setTheme:function(a,b){if(!a)return!1;b||(b=this.i.Oc.eX+a+"/style.css");-1==g.inArray(b,this.i.Oc.ska)&&(h({url:b}),this.i.Oc.ska.push(b));this.i.Oc.lB!=a&&(this.Qa.removeClass("oj-tree-"+this.i.Oc.lB),this.i.Oc.lB=
a);this.Qa.addClass("oj-tree-"+a);this.i.Oc.nF?this.Bda():this.W9();this.i.Oc.icons?this.QW():this.PU()},Iza:function(){return null!=this.i.Oc},fNa:function(){return this.i.Oc.lB},isIcons:function(){return this.i.Oc.icons},QW:function(){this.i.Oc.icons=!0;this.Qa.children("ul").removeClass("oj-tree-no-icons")},PU:function(){this.i.Oc.icons=!1;this.Qa.children("ul").addClass("oj-tree-no-icons")},toggleIcons:function(){},Ata:function(){this.i.keys.AHa=!0},Sya:function(){this.Jya();this.Iya();this.n$(!0);
this.Uya();this.Fo().Nha();this.Hya();this.Wya();this.Rya();this.o$();this.Vya();this.Fo().Mha();this.Ss()},qc:function(a,b,c){if(b&&"string"===g.type(b)&&(!0!==this.i.la.locked||"unlock"===b||"isLocked"===b||"lock"===b)){var d,e=Array.prototype.slice.call(arguments);d=this.Qa;var f="before"===b,h=c?!1:!0;h||(b="_tree"+b);var k={};k.item=a?a.obj:void 0;k.inst=d;f?(d=a.func,k.func=d,k.args=e,"rename"===d&&(k.title=a.title,k.prevTitle=a.prevTitle)):h&&("move"==b?(k.position=a.Vn,k.reference=a.Pa,k.data=
a):"rename"==b?(k.title=a.title,k.prevTitle=a.prevTitle):"remove"==b?(k.parent=a.parent,k.prev=a.prev):"delete"==b?(k.prev=a.prev,k.parent=a.parent):"expandAll"===b||"collapseAll"===b||"deselectAll"===b?k.targ=a.targ:"loaded"===b?k.item=-1:"paste"==b&&(k.position=a.Vn,k.reference=a.Pa));if(h){if(e=this._trigger(b,new g.Event("oj"+b),k),f)return"undefined"!=typeof e&&(e=e?!0:!1),e}else this.Qa.trigger(b,k)}},$C:function(a,b,c,d){"selection"===a&&(null==c&&(c=this.QT()),this.z5(b,c)||this.option(a,
c,{_context:{originalEvent:d,kb:!0},changed:!0}))},bv:function(){return this.get_rollback()},ak:function(){this.BK&&this.Qa.addClass("oj-tree-rtl").css("direction","rtl");this.Qa.html("\x3cul role\x3d'tree' tabindex\x3d'0' class\x3d'oj-tree-list' style\x3d'outline:none'"+(-1===this.i.la.Kr?" aria-multiselectable\x3d'true'":"")+" aria-labelledby\x3d'"+this.nv+"'\x3e\x3cli class\x3d'oj-tree-last oj-tree-leaf'\x3e\x3cins class\x3d'oj-tree-icon'\x3e\x26#160;\x3c/ins\x3e\x3ca class\x3d'oj-tree-loading' href\x3d'#'\x3e\x3cins class\x3d'oj-tree-icon'\x3e\x26#160;\x3c/ins\x3e"+
this.VT("stateLoading")+"\x3c/a\x3e\x3c/li\x3e\x3c/ul\x3e");this.ra=this.Qa.children("ul:eq(0)");this.Qa.data("oj-tree-instance-id",this.Pj());this.i.la.Ht=this.ra.find("li.oj-collapsed, li.oj-tree-leaf").eq(0).height()||18;this.nz&&this.Qa.delegate(".oj-tree-list ins.oj-tree-disclosure-icon","touchend.ojtree",function(a){a.preventDefault();a=g(a.target);this.toggleExpand(a)}.bind(this));this.Qa.delegate(".oj-tree-list ins.oj-tree-disclosure-icon","click.ojtree",function(a){a=g(a.target);this.toggleExpand(a)}.bind(this)).delegate(".oj-tree-list ins.oj-tree-disclosure-icon",
"mousedown",function(a){this.i.ui.pY=!0;g(a.target).removeClass("oj-default").removeClass(b.Su).addClass(b.Wm)}.bind(this)).delegate(".oj-tree-list ins.oj-tree-disclosure-icon","mouseup",function(a){g(a.target).removeClass(b.Wm).addClass("oj-default")}.bind(this)).bind("mousedown.ojtree",function(a){this.Zj();a.shiftKey&&(this.Fo()&&this.Fo().uZ()||a.preventDefault())}.bind(this)).bind("dblclick.ojtree",function(){var a;if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){a=
window.getSelection();try{a.removeAllRanges(),a.collapse(document.getElementsByTagName("body")[0],0)}catch(b){}}});this.ra.focus(function(){if(this.i.ui.pY)return this.i.ui.pY=!1;this.i.ui.dm=!0;var a;this.i.ui.jk?(this.i.ui.zc=this.i.ui.jk,a=this.i.ui.zc):this.i.ui.Nc&&0<this.i.ui.Nc.length?(this.i.ui.zc=this.i.ui.Nc,a=this.i.ui.zc):a=this.ra.find("li:first");a&&(this.hover(a),this.i.ui.jk=null,this.ra.find("a.oj-selected").removeClass("oj-tree-inactive"));return!1}.bind(this)).blur(function(){this.i.ui.dm=
!1;this.i.ui.jk=this.i.ui.zc;this.i.ui.jk&&this.dehover(this.i.ui.zc);this.ra.find("a.oj-selected").addClass("oj-tree-inactive")}.bind(this));this.qc({},"init",!0);this.taa();this.i.menu.Dh&&this.rC();c({R9:this.oz,Qca:this.ra,SE:this});this.Ata()},Hya:function(){this.i.la.locked=!1;this.Qa.addClass("oj-tree oj-tree-"+this.Pj());this.Qa.css("outline","none");this.Qa.css("MozUserSelect","none");this.Qa.css("WebkitTouchCallout","none");this.Qa.css("WebkitUserSelect","none");this.Qa.css("-ms-user-select",
"none");this.Qa.css("WebkitTapHighlightColor","rgba(0,0,0,0)")},Wya:function(){this.i.ui.selected=g();this.i.ui.Nc=!1;this.i.ui.zc=null;var a=this.options.selection;a&&"array"===g.type(a)&&0<a.length&&(this.i.ui.yG=a,this.options.selection=[]);this.nz&&this.Qa.delegate(".oj-tree-list a","touchend.ojtree",g.proxy(function(a){this.i.ui.qx=!0;this.J9(a);g(a.currentTarget).hasClass("oj-tree-loading")||this.dehover()},this));this.Qa.delegate(".oj-tree-list a","click.ojtree",function(a){this.i.ui.qx=!1;
this.J9(a);return!1}.bind(this)).delegate(".oj-tree-list a","mouseenter.ojtree",function(a){g(a.currentTarget).hasClass("oj-tree-loading")||this.hover(a.target)}.bind(this)).delegate(".oj-tree-list a","mouseleave.ojtree",function(a){g(a.currentTarget).hasClass("oj-tree-loading")||this.dehover(a.target)}.bind(this)).delegate(".oj-tree-list .oj-tree-disclosure-icon","mouseenter.ojtree",function(a){g(a.currentTarget).hasClass("oj-tree-loading")||this.A6(a.target,!0)}.bind(this)).delegate(".oj-tree-list .oj-tree-disclosure-icon",
"mouseleave.ojtree",function(a){g(a.currentTarget).hasClass("oj-tree-loading")||this.A6(a.target,!1)}.bind(this)).bind("_treereopen",function(){this.reselect()}.bind(this)).bind("_treeget_rollback",function(){this.dehover();this.saveSelected()}.bind(this)).bind("ojcollapse",function(a,b){var c=this.Ka(b.item),d=c&&c.length?c.children("ul").find("a.oj-selected"):g(),e=this;!1!==this.options.selectedParentCollapse&&d.length&&d.each(function(){"selectParent"===e.options.selectedParentCollapse?(e.deselect(this),
e.select(c)):"deselect"===e.options.selectedParentCollapse&&e.deselect(this)})}.bind(this)).bind("ojremove",function(a,b){var c=this.options.selectPrevOnDelete,d=this.Ka(b.item),d=d&&d.length?d.find("a.oj-selected"):[],e=this,f;d.each(function(){e.deselect(this);e.i.ui.jk&&(f=e.Ka(this))&&e.i.ui.jk.attr("id")==f.attr("id")&&(e.i.ui.jk=null)});c&&d.length&&b.prev&&b.prev.each(function(){if(this.parentNode)return e.select(this),!1})}.bind(this)).bind("ojmove",function(a,c){var d=c.data,e=d.uM;e&&d.g_&&
(d.g_.find("a.oj-selected").removeClass(b.Wm),d.g_.removeAttr("aria-selected"));d.Rp===d.fu||e||(e=d.Rp.i.ui,e.jk&&(d.kc.attr("id")==e.jk.attr("id")&&(e.jk=null),e.Nc&&d.kc.attr("id")==e.Nc.attr("id")&&(e.Nc=null)))}.bind(this))},o$:function(){this.Tya();this.Oya();this.Nya()},Tya:function(){1===this.i.sb.type&&(this.eea=this.options.data||null,this.Jq=this.bAa,this.Iq=this.Kza,this.Of=this.$Ba)},Oya:function(){3===this.i.sb.type&&(this.i.sb.dB&&this.Qa.bind("_treeafter_close",function(a,b){b.item.children("ul").remove()}),
this.Jq=this.dAa,this.Iq=this.Mza,this.Of=this.aCa)},Nya:function(){4===this.i.sb.type&&(this.qba(),this.Jq=this.cAa,this.Iq=this.Lza,this.Of=this.gW)},qba:function(){this.i.html.AO&&(this.i.html.VA||(this.i.html.VA=this.Qa.find(" \x3e ul"),this.i.html.VN=g("\x3cdiv id\x3d'oj-tree-existing-markup-"+this.Pj()+"' style\x3d'display:none'\x3e").append(this.i.html.VA),this.Qa.after(this.i.html.VN)),this.i.html.Lia=this.i.html.VA.find(" \x3e li"),this.i.html.mM=this.i.html.Lia.clone(!0),this.i.html.mM.find("li").addBack().contents().filter(function(){return 3==
this.nodeType}).remove())},Rya:function(){!1===this.i.Oc.eX&&(this.i.Oc.eX="themes/");this.Qa.bind("_treeinit",g.proxy(function(){var a=this.options;this.i.Oc.nF=a.dots;this.i.Oc.icons=a.icons;this.setTheme(this.i.Oc.lB,this.i.Oc.url)},this)).bind("ojloaded",g.proxy(function(){this.i.Oc.nF?this.Bda():this.W9();this.i.Oc.icons?this.QW():this.PU()},this))},Vya:function(){var a=this.options.types;a&&this.Qa.bind("_treeinit",g.proxy(function(){var b=g.extend(!0,{},a.types),c=a.attr||this.i.types.Xc.attr,
d="",e=this;g.each(b,function(a,b){g.each(b,function(a){/^(maxDepth|maxChildren|icon|validChildren)$/.test(a)||e.i.types.Yea.push(a)});var f=typeof b.icon;if("undefined"===f){f=typeof b.image;if("boolean"===f&&!b.image)b.image="ojt$none";else if(!b.image&&!b.position)return!0;b.icon={};b.image&&(b.icon.image=b.image,delete b.image);void 0!==b.position&&(b.icon.position=b.position,delete b.position)}if(b.icon.image||b.icon.position)"default"==a?(e.i.types.fA=!0,d+=".oj-tree-"+e.Pj()+" .oj-tree-list li.oj-tree-type a \x3e .oj-tree-node-icon { ",
d+=e.b4(b,d),d+="} ",d+=".oj-tree-"+e.Pj()+" .oj-tree-list li["+c+'\x3d"oj-tree-deftype"].oj-tree-type \x3e a ins.oj-tree-node-icon { '):b.icon.image&&(d+=".oj-tree-"+e.Pj()+" .oj-tree-list li["+c+'\x3d"'+a+'"].oj-tree-type \x3e a \x3e ins.oj-tree-node-icon { '),d+=e.b4(b,d),d+="} "});""!==d&&h({sO:d,title:"oj-tree-types"})},this)).bind("ojbefore",g.proxy(function(a,b){var c,d,e=b.func,f=b.item;if((c=(c=this.i.types.Xc.useData?this.Ka(f):!1)&&-1!==c&&c.length?c.data("oj-tree"):!1)&&c.types&&!1===
c[e]||-1!==g.inArray(e,this.i.types.Yea)&&b.item&&(b.item.tagName||b.item.jquery)&&(c=this.options.types.types,d=this.dU(f),(c[d]&&"undefined"!==typeof c[d][e]||c["default"]&&"undefined"!==typeof c["default"][e])&&!1===this.Rqa(e,f)))return a.stopImmediatePropagation(),!1},this))},b4:function(a){var b="",b="ojt$none"!==a.icon.image?b+(" background-image:url("+a.icon.image+"); "):b+" background-image:none; ";return b=a.icon.position?b+(" background-position:"+a.icon.position+"; "):b+" background-position:0 0; "},
Fo:function(){this.gC||(this.gC=new a.wa(this));return this.gC},iNa:function(){},Ss:function(a){var b;a||this.options.contextMenu||(b=this.Qa.attr("contextmenu"))&&(this.options.contextMenu="#"+b);if(a||this.options.contextMenu)if(b=a||this.options.contextMenu){if(b=g(b)){b.css("display","none");var c=this.i.menu;c.mf=b;c.Dh=!0}this.i.menu.Dh&&a&&this.rC()}},Sk:function(a,b){if(!b.inst&&this.i.menu.XLa==this.nv){var c=b?b.item.attr("id"):void 0;"ojtreecopy"===c?this.Csa(this.i.menu.Sn):"ojtreecut"===
c?this.Esa(this.i.menu.Sn):"ojtreepaste"===c||"ojtreepastebefore"===c||"ojtreepasteafter"===c?this.Fsa(this.i.menu.Sn,c):"ojtreeremove"===c?this.Uk(this.i.menu.Sn)?this.c6():this.c6(this.i.menu.Sn):"ojtreerename"===c?this.d6(this.i.menu.Sn):"ojtreecreate"===c&&this.Dsa(this.i.menu.Sn)}},ph:function(a,c,d){var e="keyboard"===d;if("contextmenu"==c.type||e||"touch"==d){this.i.menu.Sn=e?this.i.ui.zc:g(c.target);var f=this.i.menu.Sn.find(".oj-tree-title")[0];this.i.menu.dM=null;if(this.i.menu.Sn){this.i.menu.XLa=
this.i.menu.Sn.closest("div").attr("id");a={launcher:this.ra};e&&(a.position={of:f});if(this.i.menu.Dh&&(this.i.menu.DO||this.i.menu.vk||this.i.menu.ql)){var e=!this.i.Oe.Yq&&!this.i.Oe.Dw,h=[this.i.menu.DO,this.i.menu.vk,this.i.menu.ql],k,l,m=!1;for(l=0;l<h.length;l++)if(k=h[l])f=!!k.hasClass(b.Ye),f!=e&&(e?k.addClass(b.Ye):k.removeClass(b.Ye),m=!0);m&&this.i.menu.mf.ojMenu("refresh")}this.qh(c,d,a)}else c.preventDefault()}},Iya:function(){var a=this.options.selectionMode,a=void 0==a?"single":a;
"none"===a?a=0:"single"===a?a=1:"multiple"===a&&(a=-1);this.i.la.Kr=a;this.i.Oc.icons=this.options.icons;this.q$();this.i.la.Sp=this.options.initLoaded},lNa:function(){},n$:function(b){var c=this.options.data,d;this.i.sb.type=0;this.i.html.AO=!1;this.i.html.mM=!1;if(c)if(d=g.type(c),"string"===d)this.vza(c)?this.i.sb.type=4:this.i.sb.type=3;else if("array"===d)this.i.sb.type=3;else if("object"===d){try{c instanceof a.ud&&(this.i.sb.type=1)}catch(e){this.i.sb.type=-1}if(1!==this.i.sb.type)try{c instanceof
a.lb&&(this.i.sb.type=2)}catch(f){this.i.sb.type=-1}1!==this.i.sb.type&&2!==this.i.sb.type&&(c.data||c.ajax)&&((d=c.dataType)?"json"===d?this.i.sb.type=3:"html"===d&&(this.i.sb.type=4):(c.dataType="json",this.i.sb.type=3))}b&&0==this.i.sb.type&&0<this.Qa.find("ul").length&&(this.i.sb.type=4,this.i.html.AO=!0)},kNa:function(){},hNa:function(){},gNa:function(){},jNa:function(){},Uya:function(){var a=this.options.types;"object"===typeof a&&this.aqa(a,{attr:this.i.types.Xc.attr})},q$:function(){this.i.la.uj=
this.TFa(this.options,"initExpanded");null==this.i.la.uj&&(this.i.la.uj=[])},Jya:function(){var a=this.i;a.la={zJa:[],Kr:1,UNa:!1,Ht:0,uj:!1,Sp:!1,tj:{},px:!1,KLa:{}};a.ui={selected:g(),Nc:!1,zc:null,jk:null,pY:!1,yG:null,opacity:1,H_:!1,dm:!1,Qea:null,qx:!1};a.ui.Xc={selectMultipleModifier:"ctrl",selectRangeModifier:"shift",disableSelectingChildren:!1};a.Oe={};a.Oe.Dw=!1;a.Oe.Yq=!1;a.Oe.Xc={inputWidthLimit:200,move:{alwaysCopy:!1,openOnMove:!0,defaultPosition:"last",checkMove:function(){return!0}}};
a.Oe.tj={};a.sb={};a.sb.o_=!1;a.sb.dB=!1;a.sb.ej=!0;a.sb.type=0;a.VJa={};a.VJa.Xc={data:!1,ajax:!1};a.html={};a.html.Xc={data:!1,ajax:!1};a.html.AO=!1;a.html.VA=!1;a.html.VN=!1;a.html.Lia=!1;a.html.mM=!1;a.Oc={};a.Oc.icons=!0;a.Oc.nF=!1;a.Oc.lB="default";a.Oc.url=!1;a.Oc.ska=[];a.Oc.eX=!1;a.types={};a.types.Yea=[];a.types.fA=!1;a.types.Xc={maxChildren:-1,maxDepth:-1,validChildren:"all",useData:!1,attr:"type",types:{"default":{maxChildren:-1,maxDepth:-1,validChildren:"all"}}};a.menu={};a.menu.Dh=!1;
a.menu.mf=!1;a.menu.DO=!1;a.menu.ql=!1;a.menu.vk=!1;a.menu.Sn=!1;a.menu.dM=!1;a.keys={};a.keys.AHa=!0;a.keys.bound=[]},j7:function(a){var b=this.Qa[0];b.scrollHeight>b.offsetHeight&&(a=this.Ka(a))&&-1!==a&&a.length&&a.is(":visible")&&(a=a.offset().top-this.Qa.offset().top,0>a&&(b.scrollTop=b.scrollTop+a-1),a+this.i.la.Ht+(b.scrollWidth>b.offsetWidth?r:0)>b.offsetHeight&&(b.scrollTop+=a-b.offsetHeight+this.i.la.Ht+1+(b.scrollWidth>b.offsetWidth?r:0)))},Zj:function(){},xNa:function(){},JAa:function(){return++p},
Pj:function(){return this.Cya},Av:function(){return g.extend(!0,{},this.options)},TMa:function(){return this.Qa},UMa:function(){return this.ra},oz:{up:function(){this.hover(this.Dq(this.i.ui.zc||this.i.ui.Nc||-1));return!1},"ctrl+up":function(){this.hover(this.Dq(this.i.ui.zc||this.i.ui.Nc||-1));return!1},"shift+up":function(){this.select(this.Dq(this.i.ui.zc||this.i.ui.Nc||-1),-1!==this.i.ui.Kr);return!1},down:function(){this.hover(this.zv(this.i.ui.zc||this.i.ui.Nc||-1));return!1},"ctrl+down":function(){this.hover(this.zv(this.i.ui.zc||
this.i.ui.Nc||-1));return!1},"shift+down":function(){this.select(this.zv(this.i.ui.zc||this.i.ui.Nc||-1),-1!==this.i.ui.Kr);return!1},left:function(){var a=this.i.ui.zc||this.i.ui.Nc;a&&(a.hasClass(b.Gl)?this.collapse(a):this.hover(this.Dq(a)));return!1},"ctrl+left":function(){var a=this.i.ui.zc||this.i.ui.Nc;a&&(a.hasClass(b.Gl)?this.collapse(a):this.hover(this.Dq(a)));return!1},"shift+left":function(){var a=this.i.ui.zc||this.i.ui.Nc;a&&(a.hasClass(b.Gl)?this.collapse(a):this.hover(this.Dq(a)));
return!1},right:function(){var a=this.i.ui.zc||this.i.ui.Nc;a&&a.length&&(a.hasClass(b.Qh)?this.expand(a):this.hover(this.zv(a)));return!1},"ctrl+right":function(){var a=this.i.ui.zc||this.i.ui.Nc;a&&a.length&&(a.hasClass(b.Qh)?this.expand(a):this.hover(this.zv(a)));return!1},"shift+right":function(){var a=this.i.ui.zc||this.i.ui.Nc;a&&a.length&&(a.hasClass(b.Qh)?this.expand(a):this.hover(this.zv(a)));return!1},space:function(){this.i.ui.zc&&(this.i.ui.H_=!0,this.i.ui.zc.children("a:eq(0)").click(),
this.i.ui.H_=!1);return!1},home:function(){this.hover(this.ra.find("li:first"));return!1},end:function(){var a=this.ra.find("li.oj-tree-last:visible");a&&a.length&&this.hover(a[a.length-1]);return!1},"*":function(){this.ra.find("a");this.MS(-1,!1);return!1},"ctrl+space":function(){if(this.i.ui.zc){var a=g.Event("click");a.ctrlKey=!0;this.i.ui.zc.children("a:eq(0)").trigger(a)}return!1},"shift+space":function(){if(this.i.ui.zc){var a=g.Event("click");a.shiftKey=!0;this.i.ui.zc.children("a:eq(0)").trigger(a)}return!1},
"shift+home":function(a){var b,c=this.i.ui.zc;if(c){var d=!0,e=this,f=this.ra.find("li:visible");this.i.la.px=!0;b=this.options.selection.slice(0);c=c[0];g.each(f,function(a,b){b==c&&(d=!1);e.yn(b,!0);return d});this.i.la.px=!1;this.$C("selection",b,null,a)}return!1},"shift+pgdn":function(a){var b,c=this.i.ui.Nc||this.i.ui.zc;if(c){var d=!1,e=this,f=this.ra.find("li:visible");this.i.la.px=!0;b=this.options.selection.slice(0);c=c[0];g.each(f,function(a,b){d||(d=b==c);d&&!e.Uk(b)&&e.yn(b,!0);return!0});
this.i.la.px=!1;this.$C("selection",b,null,a)}return!1},f2:function(){this.d6(this.i.ui.zc||this.i.ui.Nc);return!1},del:function(){this.remove(this.i.ui.zc||this.Ka(null));return!1}},rC:function(){if(this.i.menu.Dh){var a=this.i.menu.mf,b=this;a.on("ojselect",g.proxy(this.Sk,this));var c=!1;a.find("[data-oj-command]").each(function(){var a;0===g(this).children("a").length&&(a=g(this).attr("data-oj-command").split("oj-tree-"),g(this).replaceWith(b.Kj(a[a.length-1])),g(this).hasClass("oj-menu-divider")&&
g(this).removeClass("oj-menu-divider").addClass("oj-menu-item"),c=!0)});c&&a.ojMenu("refresh");this.i.menu.DO=a.find("#ojtreepaste");this.i.menu.ql=a.find("#ojtreepasteafter");this.i.menu.vk=a.find("#ojtreepastebefore")}},gv:function(){var a=this.i.menu;a.Dh&&(a.Dh=!1,a.mf.off("ojselect"),a.mf=null)},Kj:function(a){return g(this.ag(a))},ag:function(a){return"\x3cli id\x3d"+k[a]+"\x3e"+this.xC(a)+"\x3c/li\x3e"},xC:function(a){return'\x3ca href\x3d"#"\x3e'+this.VT(l[a])+"\x3c/a\x3e"},Esa:function(a){a=
a.closest("li");this.Uk(a)&&(a=null);a=this.Ka(a,!0);if(!a||!a.length)return!1;this.i.Oe.Dw=!1;this.i.Oe.Yq=a;this.qc({obj:a},"cut")},Csa:function(a){a=a.closest("li");this.Uk(a)&&(a=null);a=this.Ka(a,!0);if(!a||!a.length)return!1;this.i.Oe.Yq=!1;this.i.Oe.Dw=a;this.qc({obj:a},"copy")},Fsa:function(a,b){a=this.Ka(a);if(!a||!a.length)return!1;var c=this.i.Oe.Yq?this.i.Oe.Yq:this.i.Oe.Dw;if(!this.i.Oe.Yq&&!this.i.Oe.Dw)return!1;var d="inside";"ojtreepasteafter"===b?d="after":"ojtreepastebefore"===b&&
(d="before");this.i.Oe.Yq&&(this.b6(this.i.Oe.Yq,a,d,!1,!1,!0),this.i.Oe.Yq=!1);this.i.Oe.Dw&&this.b6(this.i.Oe.Dw,a,d,!0,!1,!0);this.qc({obj:c,Vn:d,Pa:a},"paste")},b6:function(a,b,c,d,e,f){var g=this.i.Oe.Xc.move;if(!e)return"undefined"===typeof c&&(c=g.defaultPosition),"inside"!==c||g.defaultPosition.match(/^(before|after)$/)||(c=g.defaultPosition),this.cE(a,b,c,d,!1,f);if(!0===g.alwaysCopy||"multitree"===g.alwaysCopy&&a.fu.Pj()!==a.Rp.Pj())d=!0;this.cE(a,b,c,d,!0,f)},c6:function(a){a=this.Ka(a,
!0);this.bv();this.remove(a)},d6:function(a){a=this.Ka(a);this.bv();this.e6(a,function(){})},e6:function(a,b){a=this.Ka(a);var c=this.BK,d=this.i.Oe.Xc.inputWidthLimit,e=a.children("ins").width(),f=a.find("\x3e a:visible \x3e ins").width()*a.find("\x3e a:visible \x3e ins").length,h=this.getText(a),k=this,l=g("\x3cdiv /\x3e",{css:{position:"absolute",top:"-200px",left:c?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),m=a.css("position","relative").append(g("\x3cinput /\x3e",{value:h,"class":"oj-tree-rename-input",
css:{padding:"0",border:"1px solid silver",position:"absolute",left:c?"auto":e+f+4+"px",right:c?e+f+4+"px":"auto",top:"0px",height:this.i.la.Ht-2+"px",lineHeight:this.i.la.Ht-2+"px",width:"150px"},blur:g.proxy(function(){var c=a.children(".oj-tree-rename-input"),d=c.val();""===d&&(d=h);l.remove();c.remove();this.LW(a,h);this.ica(a,d);b.call(this,a,d,h);a.css("position","")},this),keyup:function(a){a=a.keyCode||a.which;if(!k.ES)return k.ES=!0,!1;27==a?(k.ES=!1,this.value=h,this.blur()):13==a?(k.ES=
!1,this.blur()):m.width(Math.min(l.text("pW"+this.value).width(),d))},keypress:function(a){if(13==(a.keyCode||a.which))return!1}})).children(".oj-tree-rename-input");this.LW(a,"");l.css({fontFamily:m.css("fontFamily")||"",fontSize:m.css("fontSize")||"",fontWeight:m.css("fontWeight")||"",fontStyle:m.css("fontStyle")||"",fontStretch:m.css("fontStretch")||"",fontVariant:m.css("fontVariant")||"",letterSpacing:m.css("letterSpacing")||"",wordSpacing:m.css("wordSpacing")||""});m.width(Math.min(l.text("pW"+
m[0].value).width(),d))[0].select()},Dsa:function(a,c,d,e,f){var h=this;(a=this.Ka(a))||(a=-1);this.bv();return this.MC(a,c,d,function(a){var c=this.ln(a),d=g(a).index();e&&e.call(this,a);c.length&&c.hasClass(b.Qh)&&this.expand(c,!1,!0);f?h.qc({obj:a,name:this.getText(a),parent:c,position:d}):this.e6(a,function(a,b){h.qc({obj:a,name:b,parent:c,position:d})})})},vza:function(a){var b=!1;a&&3<=a.length&&(a=a.trim(),b="\x3c"===a.charAt(0));return b},bqa:function(){var a=this.options.emptyText;"string"!==
typeof a&&(a=this.VT("labelNoData"));if(a&&0<a.length){var b=this.ra,c=g("\x3cli class\x3d'oj-tree-empty'\x3e\x3c/li\x3e");c[0].textContent=a;b.empty().append(c)}},EBa:function(a){var b,c,d;d=null;var e;a&&(b=a.subId);if(!b)return null;d=b.split("[");if(3===d.length&&(d[0]=d[0].trim(),"oj-tree-node"===d[0]&&(d[1]=d[1].trim(),b=d[1].charAt(0),b=d[1].indexOf(b,1),0<=b&&(a=d[1].substring(1,b).trim(),d[2]=d[2].trim(),b=d[2].charAt(0),b=d[2].indexOf(b,1),0<=b)))){d=d[2].substring(1,b).trim();try{c=this.Ka(a)}catch(f){c=
null}if(d&&c&&-1!==c)switch(d){case "icon":this.i.Oc.icons&&(e=c.find(" \x3e a \x3e ins:eq(0)"));break;case "link":e=c.find(" \x3e a:eq(0)");break;case "disclosure":this.iV(c)||(e=c.find(" \x3e ins:eq(0)"));break;case "title":e=c.find(" \x3e a \x3e span")}}return e?e.length?e[0]:null:null},Uva:function(a){var b=a?this.Ka(a):null,c,d=null;b&&-1!=b&&b.length&&b.hasClass("oj-tree-node")&&a.tagName&&a.parentNode&&(b=a.tagName,c=a.parentNode,c=c.tagName,"SPAN"===b?d="title":"A"===b?d="link":"INS"===b&&
(a=g(a),"LI"===c&&a.hasClass("oj-tree-disclosure-icon")?d="disclosure":"A"===c&&a.hasClass("oj-tree-node-icon")&&(d="icon")));return d},W9:function(){this.i.Oc.nF=!1;this.Qa.children("ul").addClass("oj-tree-no-dots")},Bda:function(){this.i.Oc.nF=!0;this.Qa.children("ul").removeClass("oj-tree-no-dots")},Dza:function(){var a=this.options.initExpanded;return a&&"all"==a||g.isArray(a)&&a.length&&"all"==a[0]},VT:function(a){var b=this.i.la.KLa,c;c=b[a];c||(c=this.F(a),c=this.$I(c),b[a]=c);return c},$I:function(a){var b=
document.createElement("div");g(b).text(a);return b.textContent},aNa:function(){return this.i.la.Ht},lua:function(){var a=0,b,c;window.getComputedStyle&&(c=this.i.ui.Qea,c||(c=g("\x3cdiv id\x3d'ojtree-comp-animduration'\x3e\x3cspan class\x3d'oj-tree-transition'\x3edummy\x3c/span\x3e\x3c/div\x3e"),this.i.ui.Qea=c,g("body").append(c)),b=c[0].childNodes[0],b=window.getComputedStyle(b),b=b.transitionDuration?b.transitionDuration:b["-webkit-transition-duration"]?b["-webkit-transition-duration"]:0,c.detach(),
"string"==typeof b&&1<b.length&&(c=b.charAt(b.length-1).toLowerCase(),"s"==c?(b=b.substring(0,b.length-1),b=parseFloat(b),isNaN(b)||(a=1E3*b)):2<b.length&&(c=b.substring(b.length-2).toLowerCase(),"ms"==c&&(b=parseFloat(b),isNaN(b)||(a=b)))));return a},TFa:function(a,b){var c={};c[b]=a[b];return g.extend(!0,{},c)[b]},rea:function(a){this.qc({obj:{msg:a}},"trace",!0)}})})()});